aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes mock: garbage collector Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "mock: garbage collector" Watch "mock: garbage collector" New topic
Author

mock: garbage collector

adam Lui
Ranch Hand

Joined: Sep 03, 2007
Posts: 186
source : learnKey

which request(s) that the garbage collector executes?
A. System.gc();
B. System.runGC();
C. System.getRuntime().gc();
D. Runtime.gc();
E. Runtime.runGC();
F. Runtime.getRuntime().gc();

I picked A, F in the mock exam,
but since it didnt auto save the report and i closed the software by accident,
i am not sure the answers.
Gaurav Bhatia
Ranch Hand

Joined: Jan 01, 2007
Posts: 49
A and F are correct.
Try compiling the code.


~Gaurav<br />SCJP5
Jari Timonen
Ranch Hand

Joined: Jan 16, 2004
Posts: 232
A and F are correct.


SCJP 5.0, SCJD URLyBird 1.3.3, OCMJEA 5 (SCEA) Factory Homes
Fu Dong Jia
Ranch Hand

Joined: May 23, 2007
Posts: 131
A and F are correct.


who dare win!<br />SCJP5(94%)|SCWCD5(86%)|SCBCD(100%)|SCEA in progress
Raghavan Muthu
Ranch Hand

Joined: Apr 20, 2006
Posts: 3344

Yes, A and F are correct though C seems to be so!


Everything has got its own deadline including one's EGO!
[CodeBarn] [Java Concepts-easily] [Corey's articles] [SCJP-SUN] [Servlet Examples] [Java Beginners FAQ] [Sun-Java Tutorials] [Java Coding Guidelines]
Sid Robin
Ranch Hand

Joined: Nov 24, 2007
Posts: 53
I assume option D is also right

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#gc()
Kelvin Chenhao Lim
Ranch Hand

Joined: Oct 20, 2007
Posts: 513
Originally posted by Sid Robin:
I assume option D is also right

http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html#gc()


Nope. Runtime's gc() method is a non-static method, so you can't invoke it without an instance of Runtime.


SCJP 5.0
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: mock: garbage collector