aspose file tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Clarify Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Clarify "at line #" on exam" Watch "Clarify "at line #" on exam" New topic
Author

Clarify "at line #" on exam

Kevin O'Mara
Greenhorn

Joined: Apr 03, 2009
Posts: 7
When the exam question says - what is true at line 14, does that mean before the code at line 14 is executed, or the code at line 14 has been executed?
Byju Joy
Ranch Hand

Joined: Sep 06, 2005
Posts: 84
Right, there is ambiguity. Could you post that question?
Ankit Garg
Saloon Keeper

Joined: Aug 03, 2008
Posts: 9189
    
    2

Well it generally means that when the code at line 14 is getting executed . So basically you can say that before line 14 is executed. Actually it depends on the options. Lets take a dummy question



What is true at line 3
1. d is eligible for garbage collection - true
2. d is garbage collected - false as this is not guaranteed
3. an exception is thrown - true


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Kevin O'Mara
Greenhorn

Joined: Apr 03, 2009
Posts: 7
I don't remember the exact code from the question - but it was something like:



In my example, the question would be phrased "how many objects are eligible for garbage collection at line 18? This is the closing brace of the method getT1(). I believe the answer is 2 if at line 18 means the JVM is about to execute line 18, but 3 if line 18 has been executed and the method has ended.
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8712
The real exam probably does a better job than most mock exams in terms of avoiding such ambiguities. I think you'll see a couple of more or less standard approaches on the real exam:

15. m1.x = null;
16. // doStuff
17. }

When line 16 is reached...


or

16. // some code

After line 16 executes...

hth,

Bert


Eliminate fossil fuel subsidies. (If you're not on the edge, you're taking up too much room.)
Kevin O'Mara
Greenhorn

Joined: Apr 03, 2009
Posts: 7
The example is from the real exam (more or less). The point I remember for sure is the at line # was the closing brace for the method - which is of course after the return statement. Obviously makes a big difference whether the method is totally over and the instance variables have been free'd - or if they are about to be free'd.

Is there anywhere one can go to get a definitive clarification?
Bert Bates
author
Sheriff

Joined: Oct 14, 2002
Posts: 8712
Hi Kevin,

No offense, but what you've described isn't on the SCJP 6 exam. So, there's some little detail that you've forgotten. I checked with Sun and, while there are questions similar to what you remember, in every case there is some important difference than what you've discussed.

hth,

Bert
Kevin O'Mara
Greenhorn

Joined: Apr 03, 2009
Posts: 7
Bert - I just took the SCJP 6 exam Monday. I don't remember the exact code snippet - and they have pretty strict rules about writing things down to take with you - LOL. I am certain that the question was "how many objects are eligible for garbage collection at line 14 (in the real test). And I am certain that line 14 was the closing brace for the method.

Maybe I overlooked some other trick that would have made the question of whether or not the method was over and "cleaned up" a moot point - e.g., line 14 was after the return. I answered "2" - using the analogy of a Debugger; if the Debugger was at line 14, it would be ready to "step into line 14" and end the method. Of course being the real exam, I also don't know if "2" was the correct answer.

Regardless, you mentioned that you checked with Sun - how did you do that? I've looked at the Prometric and Sun sites and don't see where I can pose such a question directly.

Thanks for your attention to this question. As you might guess, I did not pass - but was very close. When I retake the exam, I can't afford to miss any questions due to misunderstanding the question - not the concept.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: Clarify "at line #" on exam
 
Similar Threads
Order of Initialization
RequestDispatcher.forward()/include(), HttpServletResponse.sendRedirect() and HttpServlet.destroy()
HashSet question
Object constructor and initialization
Exceptions Execution flow