This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes Java in General and the fly likes System vs Runtime Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » Java in General
Bookmark "System vs Runtime" Watch "System vs Runtime" New topic
Author

System vs Runtime

Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8927

Hi,
Is there any difference between the gc method in System and Runtime Class. I dont think so. My query, Why do we need the same method in different classes?


Groovy
Mani Ram
Ranch Hand

Joined: Mar 11, 2002
Posts: 1140
There are no differences. Actually a call to System.gc() will call the gc() method in the Runtime class.
The gc() method in System.java is


Mani
Quaerendo Invenietis
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Why do we need the same method in different classes?
We don't, really. My theory is this is just something that they first put in Runtime, and later realized it would be more convenient to have in System, but in the rush to get JDK 1.0 out the door, they left the method in both classes, and now it's too late to change. (Or at least, it's not worth the bother of changing.)


"I'm not back." - Bill Harding, Twister
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: System vs Runtime
 
It's not a secret anymore!