RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
I am not sure that I would say, “initialised.” I would probably say, “executed,” but the Java® Language Specification (=JLS) is clear about the order of execution. Please look for yourself. Please say superclass and subclass rather than parent and child.Jesse Silverman wrote:. . . "True or false? Instance initializer blocks run before any constructors are initialized."
Another JLS section.. . . char is an integral numeric type, but is unsigned . . .
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
I looked up the Java8 JLS version because it has what some more recent versions don't: a proper index. I couldn't find “type witness”. If it isn't in the JLS it probably won't come up in the exam. Look in the JLS in preference to the Java™ Tutorials.Jesse Silverman wrote:. . . "Type Witness" . . .
Jesse Silverman wrote:
1.
"True or false? Instance initializer blocks run before any constructors are initialized."
When I see that, my mind immediately says "FALSE!! I see that sneaky word ANY!! All parent constructors will fully complete before my own instance initializer block begins!" At one point in my studies I either forgot that or was hesitant enough of the fact that I took too long on the question.
Provided Answer:
"True. Fields and instance initializer blocks are run first, in the order they appear, followed by any constructor calls."
Jesse Silverman wrote:I also found this flash card confusing or ambiguous:
True or false? A switch statement can use a var, provided the var is marked final.
The answer is false either way, but it was not clear if they meant the value to switch on, or as one of the case values.
Jesse Silverman wrote:This one is probably just a silly typo, but really had me wracking my brains thinking it was a trick question:
Write a statement to create a three-dimensional primitive integer array initialized with the values [1 2] [3 4].
The answer:
int[][] array = {{1,2}, {3,4}};
seems to show they just meant to ask for a two-dimensional primitive integer array.
Please note that trick questions are intentionally included on flash cards, so it wasn't paranoia.
Jesse Silverman wrote:Q:"What is the syntax of a case statement?"
A: "case <value> : <expression>"
I may be confused, and Java 12 added switch expressions which I haven't looked at yet, but for classic switch/case statements,
I would say:
case <value> : <statement or code block>
an expression can be a statement (sometimes), but a code block can certainly be the target of a case statement, and that is NOT an expression, right?
[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
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
[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
RTFJD (the JavaDocs are your friends!) If you haven't read them in a long time, then RRTFJD (they might have changed!)
I don't like that guy. The tiny ad agrees with me.
The Low Tech Laboratory Movie Kickstarter is LIVE NOW!
https://www.kickstarter.com/projects/paulwheaton/low-tech
|