Forums Register Login

Assessment Test For OCAJP 8 Programmer 1

+Pie Number of slices to send: Send
The book mentions it will provide line numbers for code samples so you know if you're looking at a snippet or the entire contents of the source.
Question 2:  No line numbers for code so I assumed it would not compile.
Question 7 : No line numbers for code so I assumed it would not compile.
Question 15 : No line numbers but the choices you're given imply that it's ok in this case.
+Pie Number of slices to send: Send
Welcome to CodeRanch!

Which book are you referring to? can you please QuoteYourSources
1
+Pie Number of slices to send: Send
Hi Mike Rithgen,
Warm Welcome to Coderanch .

The book mentions it will provide line numbers for code samples so you know if you're looking at a snippet or the entire contents of the source.  


If the question tests to find compile time error at particular line, it may contain line numbers  to ask you at what line compile time error occurs ?
Some questions ask you to select output then what is the need to have line numbers If code doesn't contain compile time errors.
There is no specific rule that "Code should contain line numbers ". Remember line numbers are not part of code snippet. Read and understand the question properly when you are answering the question.

Hope it helps !
+Pie Number of slices to send: Send
If I'm not wrong, you're referring to OCA 8 Sybex. As Narayana mentioned It is not necessary all code snippet to have line numbers. It depends on questions and their options provided.

Some questions are provided with output options and one of them can be The code doesn't compile. It's in Question 2 in that case there is no need to provide line number. Same for Q7.

If the question had options asking specific line of code causes compile time error having options like Compiler error on line 2 Or The code will not compile because of line 3 etc. in that case code snippet may have line numbers as like Question 1 in Assessment Test.
+Pie Number of slices to send: Send
Thanks for the quick reply guys.  
+Pie Number of slices to send: Send
Mike,
After the book came out, Oracle decided to ditch this. Now you get to assume code is a snippet even without the line numbers. So you don't have to hunt down missing imports. Yay!

In other words, don't think too much about this as you won't have to on the real exam.
incandescent light gives off an efficient form of heat. You must be THIS smart to ride this ride. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 370 times.
Similar Threads
Errata K&B7
How to count the number of compiler errors? (Java OCA 8 Programmer I Study Guide, Sybex)
OCA Exam question formating.
Import missing in CH7 Q10 on p412 (K&B7)
Exception handling unreachable code after try-catch block
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 00:16:55.