4

I have started learning about C# and I come to what is called 'Automatic memory management' or 'Garbage collectors' and I'm wondering if Java contains something like this as well? and if it does, does it do that as effective as C# when it comes to windows desktop application and web applications?

Adam Lear
32.1k8 gold badges104 silver badges126 bronze badges
asked Nov 14, 2011 at 0:21

3 Answers 3

6

Java is a garbage collected language though the collection model is different than C#'s. Effectiveness would vary considerably depending on the structure of the program but Java does run just fine on Windows and the Web.

answered Nov 14, 2011 at 0:27
1
4

Yes, the algorithm used by the Microsoft's 'Common Language Runtime' is known as the Mark-Compact Algorithm. I also read that the Java Runtime uses this as well. Also, if you run into any other C# vs Java sort of comparison like questions, this document may be of interest. A Comparison of Microsoft's C# Programming Language To Sun Microsystems' Java Programming Language, By Dare Obasanjo.

answered Nov 14, 2011 at 3:23
3

Yes, Java does have garbage collection and "effective" is a relative term hard to judge without some more specific criteria.

answered Nov 14, 2011 at 0:27

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.