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?
Tell me more
×
Programmers Stack Exchange is a question and answer site for
professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.
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. |
|||||
|
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. |
|||
|
Yes, Java does have garbage collection and "effective" is a relative term hard to judge without some more specific criteria. |
|||
|