(1) question 12 of the second practise test. There is a code which throws "IllegalThreadSateException", and it is considered to be correct! No explanation for that option (G) available.
(2) question 27 of the second practise test. It has strange explanation: "method parseBoolean doesn't exists". In fact method parseBoolean exists, but it returns boolean, so you cannot call a getClass from it.
(3) question 8 of the third practise test. It states that thread g would throw InterruptedException because it is being interrupted while sleeping, but in fact - whether we really can state that thread g will start its run method before g.interrupt() is called? A sketch of a code:
(4) question 17 of the third practise test. This question is about English language, not Java language what does the following phrase mean:
Drag and drop appropriate fragments to the given slots, so that produces a unique output at every times.
I dont understand whether the task is to produce RANDOM output or CONSTANT? A correct answer produces CONSTANT output for every run of the program. While from my point of view "unique at every times" means "different every time".
(5) Attached is the question 27 of the third practise test. I wonder why the correct answer prints zero six times, but not three times?
Joined: Apr 14, 2010
Here is the correct answer for question 44 from the third practise exam. Why can't I insert "throw new RuntimeException()" insted of "wait(78L)"?
Joined: Apr 14, 2010
question 54 of the third practise test
Why can we state that s1 thread will get its lock faster than main thread?
First of all thank you very much for taking your time to provide the feedback.
(1). IllegalThreadStateException is an unchecked exception - it extends RuntimeException. Therefore, you can use it in the throws part of a method declaration without having any effect and thus the option (G) is correct.
(2). Yes, this is an error and it was identified and corrected long ago with the Beta* release.
(3). It was assumed that the sleep method takes the exact time as the value which was passed as the argument for that method, and all other executions take negligible time for the execution. This type of questions are there in the sun exams - but with an explicit statement which mentions the above assumption. This is in the current Beta update which will be released in next month
(4). Typos happen eveywhere.
(5). Did you try running this program yourself, before you found this as an error?
(6). If you insert "throw new RuntimeException()", you will get a compile time error, which clearly states why you cannot use it. Please try it out.
(Hint: InterruptedException is a checked exception).
Dmitry Zhuravlev wrote:both threads aquire s1 lock. why can we state that s1 thread will get it first?
Same reason for question 3.
I appreciate your feedback and thanks again for that. Please let me know if you have any question.
Devaka, thank you for your answers! This clarifies my problems. I will doublecheck all these questions.
As for my question one - it was not about the correctness of the answer, but about the misprint: IllegalThreadSATEException.
By the way, how many identical questions presented in 5.0 and 6.0 versions of your test? By this I want to know can the ExamLab 5.0 be recommended for preparation to SCJP 6.0 also, or most of the questions are similar?
Dmitry Zhuravlev wrote:I have scored only 48% on Final Exam... One of the reasons - to little time... last 10 or 15 questions I was in a great hurry and no time for going back to skipped questions
Time management is a skill that you should improve for any type of exam.
Dmitry Zhuravlev wrote:Anyway, here is a question: why cant I use the 'private' modifier instead of 'static' word in the enum declaration? If I can, then my answer is correct, but it can be considered incorrect by the test.
Aren't you using the beta version of ExamLab? This error was already recognized and corrected with that release.