Ask Experts Questions for FREE Help!
  Advanced
Register  |  Log in  
   Ask    
 Answer  
  Help  

Ask QuestionsprogressAnswer QuestionsprogressBuild ReputationprogressBecome an Expert
 
Free Answers in 3 Easy Steps

Register Now
3 Steps

At Ask Me Help Desk you can ask questions in any topic and have them answered for free by our experts. To ask questions or participate in answering them you must register for a free account. By registering you will be able to:
  • Get free answers from experts in any of our 300+ topics.
  • Accept money for answers that you provide.
  • Communicate privately with other members (PM).
  • See fewer ads.

Home > Computers & Technology > Programming > Compiled Languages > Java   »   java programming

 
Thread Tools Display Modes
Question
 
 
#1  
Old Mar 22, 2003, 11:03 AM
Suttaa
-
Suttaa is offline
 
Join Date: Mar 2003
Location: Sri Lanha
Posts: 3
Suttaa See this member's comment history on his/her Profile page.
Send a message via ICQ to Suttaa
java programming

read the following statements and explain y it is either true or false
1. the garbage collection mechanism is platform dependent
2.u can suggest when garbage collection will run but u cannot be certain when it will take place.
3.a reference to a primitative variable is eligble for garbage collection when it is set to null.
4.the automtic garbage collection of java virtual machine prevents programs from ever running out of memory

Reply With Quote
 
     

Answers
 
 
Old Mar 22, 2003, 08:18 PM   #2  
YDG
New Member
YDG is offline
 
Join Date: Mar 2003
Location: New Zealand
Posts: 4
YDG See this member's comment history on his/her Profile page.
Send a message via ICQ to YDG
Re: java programming

1. the garbage collection mechanism is platform dependent

I don't really know, but Java is supposed to run the same, regardless of the operating system  (it's one of the benefits of using Java). Possibly it could depend on the JVM beung used, but I'd be surprised if this was the case.

2.u can suggest when garbage collection will run but u cannot be certain when it will take place.

Well, garbage collection is done by a daemon thread, and like all threads, you can specify when something should run, but that doesn't necessarily mean that it will run when you say I'm not sure you can actually invoke the garbage collection thread to run at a certain time (it's a background process that runs whenever higher priority threads stop/pause), but assuming you can invoke it, it'll be subject to all the quirks that normal threads are

3.a reference to a  primitative variable is eligble for garbage collection when it is set to null.

Not sure. As far as I know, a variable is eligible for garbage collection if it is never reffered to in the program again- I could probably think of a few times when testing to see if a primitive is null is actually a useful thing to do (such as I/O streams), which obviously wouldn't work if the garbage collector had come along and killed it

4.the automtic garbage collection of java virtual machine prevents programs from ever running out of memory

Again, I don't really know That may be it's intention, but stick a few infinte loops in your program and I'd be willing to bet things would lock up ;D
  Reply With Quote
 
     


Thread Tools
Display Modes

 
Similar Sponsors

Similar Threads
Question Asker Forum Answers Last Post
java programming kishorekumar Java 1 Sep 14, 2006 12:10 AM
c programming REMYA C 1 Jan 20, 2006 08:38 PM
Java/Windows Programming dagma20 Java 0 Apr 3, 2005 06:21 PM
java programming Suttaa Java 1 Dec 11, 2003 05:03 AM
C programming mehdi C 1 Nov 13, 2003 06:19 AM




Copyright ©2003 - 2007, Ask Me Help Desk.
All times are GMT -8. The time now is 12:18 PM.