aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Dans GC Mock - Problem ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Dans GC Mock - Problem ?" Watch "Dans GC Mock - Problem ?" New topic
Author

Dans GC Mock - Problem ?

Michael Taupitz
Greenhorn

Joined: Nov 26, 2002
Posts: 11
In Dans Mock-Exam about GC (Study Guide Chapter 8, Mock 1) is a problem about the correct answer.

Which of the following are true statements and which of the following could be a result of attempting to compile and run the program?
a. Prints: XY
b. Prints: YX
c. Prints: XXYY
d. Prints: YYXX
e. Nothing is printed.
f. There is no guarantee that the garbage collector will run.
g. Compiler Error.
h. Run Time Error.
i. None of the above.
-------------------------------------
Dan says answers a,b,e,f .
But, if answer f is correct (and i would say, thats the only correct answer) all other answers are incorrect - or ?
Michael


SCJP 1.4, OCUPF (OMG Certified UML Professional Fundamental), SCEA - I
Vivek Talyan
Greenhorn

Joined: Sep 03, 2002
Posts: 13
Originally posted by Michael Taupitz:
In Dans Mock-Exam about GC (Study Guide Chapter 8, Mock 1) is a problem about the correct answer.

Which of the following are true statements and which of the following could be a result of attempting to compile and run the program?
a. Prints: XY
b. Prints: YX
c. Prints: XXYY
d. Prints: YYXX
e. Nothing is printed.
f. There is no guarantee that the garbage collector will run.
g. Compiler Error.
h. Run Time Error.
i. None of the above.
-------------------------------------
Dan says answers a,b,e,f .
But, if answer f is correct (and i would say, thats the only correct answer) all other answers are incorrect - or ?
Michael

The question asks you what 'could' happen. So, if the garbage collection runs and the objects of class B are garbage collected, 'a' and 'b' might happen. Otherwise, if the gc does not run (which is what 'f' says) then nothing will be printed.


SCJP2 (1.4)
Michael Taupitz
Greenhorn

Joined: Nov 26, 2002
Posts: 11
Thanx Vivek, i'd overseen this could. But is it correct to say - what could happen - or not.
Mayba all can happen - it could also happen a OutOfMemoryException - or ? ;-)
Okay, but this gives me a feeling for the real exam..... ;-)
Michael
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Dans GC Mock - Problem ?
 
Similar Threads
Help!!, problem with Dan question
Dan's question: ambiguous?
Oerator precedence
regarding overloading-Dan Chisholm's Mock Exam question
finalize() not only for GC eligible Objects?