The unchecked exception classes are the run-time exception classes and the error classes.
The checked exception classes are all exception classes other than the unchecked exception classes. That is, the checked exception classes are Throwable and all its subclasses other than RuntimeException and its subclasses and Error and its subclasses.
[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
Guram Savinov wrote:Page 21
Java Primitive Types
Example of long '123' should be '123L' like the float example '123.45f'
[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
Guram Savinov wrote:Same page 21
2^8 is 2 × 2 = 4 × 2 = 8 × 2 = 16 × 2 = 32 × 2 = 64 × 2 = 128 × 2 = 256
Should be 2^8 is 2 × 2^7 = 4 × 2^6 = 8 × 2^5 = 16 × 2^4 = 32 × 2^3 = 64 × 2^2 = 128 × 2^1 = 256
[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
Guram Savinov wrote:Page 22
hexadecimal (digits 0–9 and letters A–F)
lowercase 'a-f' is correct characters for hex literals as well
[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
float primitive defaults to 0.0
float and double primitives defaults to 0.0
toif we compile from /my/directory
if we compile from /my/directory and run it with java named.A.Bird
Guram Savinov wrote:Chapter1 review question 12, answer F and explanation.
float primitive defaults to 0.0
0.0 is a double literal (same as 0.0d), so even if would be instance variable it's still not correct.
It would be corect if answer is 0.0F or 0.0f and it's an instance variable.
Guram Savinov wrote:Chapter1 review question 11 explanation isnt clear about 0.0 literal too:
float and double primitives defaults to 0.0
Guram Savinov wrote:Question 14 is not enough described: you didn't mention about runnning class in JVM, just about comiling.
Actually javac compiles any package declaration without any problem, but after that you should put .class file to appropriate directory to run bytecode.
And the Bird class must have main method if we going to run it in JVM.
[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:
Guram Savinov wrote:Chapter1 review question 12, answer F and explanation.
float primitive defaults to 0.0
0.0 is a double literal (same as 0.0d), so even if would be instance variable it's still not correct.
It would be corect if answer is 0.0F or 0.0f and it's an instance variable.
Agreed. Good catch. I've added this to the errata.
Maybe answer F for question 12 on page 46 should be 0.0f too.
There is no requirement that second and third expressions in ternary operations have
the same data types, although it may come into play when combined with the assignment
operator.
[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
This code demonstrates three variations of the for loop you may not have seen. First, you
can declare a variable, such as x in this example, before the loop begins and use it after it
completes.
Guram Savinov wrote:Page 73
Figure 2.4
default branch of switch statement can have optional break as well as case branches
Guram Savinov wrote:Page 82
Example at the top:
Prints: 0 1 2 3 4 5
Instead of: 0 1 2 3 4
because of last output of x value
Guram Savinov wrote:Errata has note about x output on page 82 and says: it can be removed, but it can't, because of this:
This code demonstrates three variations of the for loop you may not have seen. First, you
can declare a variable, such as x in this example, before the loop begins and use it after it
completes.
Guram Savinov wrote:Page 85, Real World Scenario:
Should be:
because List<Integer> may contain null values
[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
In real coding, you won’t be so concerned which is returned from each method due to autoboxing.
Guram Savinov wrote:Page 135
Table 3.3
In real coding, you won’t be so concerned which is returned from each method due to autoboxing.
Actually, parseXxx(String s) and valueOf(String s) are not used during autoboxing.
Autoboxing can be done with help of methods like these (for Integer wrapper):
[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
There is no greater crime than stealing somebody's best friend. I miss you tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
|