However, the finally block runs after the try block.
Common runtime exceptions include the following:
Mushfiq Mammadov wrote:1. On page 301, exception text:
Mushfiq Mammadov wrote:Maybe I am wrong but I think it may be helpful if I am right, so I want to note
![]()
mainmethod.Zoo.main should be Zoo.main in the exception text on page 8 too.
Mushfiq Mammadov wrote:2. On page 306, the second code example:
line 3 does not compile too. It may be added comment to this line.
Mushfiq Mammadov wrote:3. On page 308, the second code example:
"DOES NOT COMPILE" have been added on line 25, but compile error occurs on line 29.
Mushfiq Mammadov wrote:4. On page 313, the first sentence:
However, the finally block runs after the try block.
Maybe try block should be catch block.
Mushfiq Mammadov wrote:5. On page 316, the first code example:
We use this for referring instance members therefore we can't use this keyword in static method. So setNumberEggs() method shouldn't be static.
Mushfiq Mammadov wrote:6. On page 317, "Checked Exceptions" section, the fourth sentence:
Common runtime exceptions include the following:
runtime should be checked.
Mushfiq Mammadov wrote:7. On page 330, question #14:
There is no typo in this question. Just I note it for informing authors about it. IOException is written two different forms: one of them without package name (line 7) and the other with package name (option D). If it is used without package name in code we guess that package has already been imported. And it can be used without package name in option D.
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeanne Boyarsky wrote: 5) Good catch! I'm impressed. You are going to great on the test if you can find this sort of thing when thinking about exceptions.
Mushfiq Mammadov wrote:
Jeanne Boyarsky wrote: 5) Good catch! I'm impressed. You are going to great on the test if you can find this sort of thing when thinking about exceptions.
But my test results are not still good enough. When I read a topic I look at examples carefully. But I hurry up for time when I take mock exam. And I make simple mistake for my carelessness.
[OCP 21 book] | [OCP 17 book] | [OCP 11 book] | [OCA 8 book] [OCP 8 book] [Practice tests book] [Blog] [JavaRanch FAQ] [How To Ask Questions] [Book Promos]
Other Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, TOGAF part 1 and part 2
Jeanne Boyarsky wrote: I don't suppose there is any pattern to the mistakes? Like can you make a checklist for yourself: 1) Look for error X. 2) Look for null pointer 3) profit?
![]()
Mushfiq Mammadov wrote:When I take mock exam without time I look through code example minimum three times. But when I take mock exam with time I look through code example maximum twice.
Mushfiq Mammadov wrote:One of the my last mistake was that I saw the valid method as constructor which its name is the same with the name of class. And I follow constructor rules. I go crazy when I saw the correct answer and explanation
Mushfiq Mammadov wrote:If we guess that Zoo class (on page 7) include in mainmethod package so we have to compile and execute it as the following:
$ javac mainmethod/Zoo.java
$ java mainmethod.Zoo Zoo
Roel De Nijs wrote:Although you are correct about the java command, you are not required to invoke the commandto compile the Zoo.java source code file. If the current directory would be the directory mainmethod, you could compile the Zoo.java source code file using the commandAnd from inside the directory mainmethod, you could even run the Zoo.class file using the option -cp