Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!

Mikalai Zaikin

+ Follow
since Jun 04, 2002
Forum Moderator
Mikalai Zaikin currently moderates these forums:
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads

Recent posts by Mikalai Zaikin

Hi !

Welcome to CodeRanch!

Can you share the source about the precedence you used?

For me these operations identical, executed from left to right:


if && had higher precedense, then first c2 would be printed.

Hi Akin,

I moved your post from "Java 8 certification" forum to "Other certifications" forum, to be more ontopic.

Regarding your question: off the top of my head -- there are plenty of courses here:

Just read feedbacks and pick which you like more.

Those courses normally cost about USD10, you can try to find promo codes and get an additional discount (or wait Black Friday sales 8-)).


Good question,

It is truly expected that you create Thread and pass Runnable via constructor, and then this thread can perform task from Runnable.

Or you code your own task inside run() method

But not both

Look here at default run() method implementation the Thread:

This answers your question: by overriding in Pooler class the run() method you denied Runnabale (a Threader) instance chance to run.

Instead your implementation of the run() executed:

There are no contradictions here.
You define enum (which is an "object blueprint") and tell -- "I have an abstract method".
Then you define inside the enum body all possible instances, and each of them is (a) concrete -- because JVM calls implicitly constructor and constructor may be called on concrete class (b) has an implementation of the abstract method
So, all are happy! 8-)
It would fail to compile if any of your declared instance did not implement "printHours", in that case it would remain abstract, and JVM would not be able to create an instance of particular enum constant.
You're right. It seems an error for me.

When in doubt -- try the compiler 8-)

These both are valid.

With Oracle any requirement can be legal 8-)
I personally get this warning when took 1Z0-817 proctored exam.
Basically, your face must be fully open and visible to the camera during the whole exam: you may not scratch your head, cover your mouth with your hand -- you will get a warning from the proctor.
The JEP 286 clearly says var is not a "type" or "keyword", rather "reserved type name"
Some of the reasons:
* because IDE will spot many non-compile problems right off, while lots of questions test specifically compilation problems
* because you won't learn command line arguments for java and javac
* because you won't learn modules layout (where put module definition, how to package module manually, etc.)
* because IDE performs auto code completion for you and methods lookups
* because IDE performs adds import statement for you, while you must know some packages names
* because IDE will wrap problematic code in try catch block and you won't bother if the code safe or not (distinguish checked v.s. runtime exception)
* some more reasons, but I am tired to list...
My understanding is if the source code (which normally is a single snippet potentially containing several classes/interfaces) does not contain import/package statements, then they are assumed to be valid and that part of the code is fine.
However, if the package/import statement[s] is present in the source code, and the question contains "Compilation fails" option, then question tests package[s] visibility and import rules must be analyzed.
Sorry, could you clarify why may consider option E correct?
The book says option D correct, you also seem tested option D and it works.

Maybe there is some confusion caused by directories names, and/or module/package names?
Try then something like

  | -


Once JVM sees "exports zoo.staff" it will start searching that package starting the directory where module definition is located, and if you put module-info.class inside the "zoo" directory, JVM modules resolver will not be able to find the first part of the package -- "zoo" directory. Exporting of non-existing packages is not allowed.


No one questions labels presence, they are in scope, from what I understand (?) the question was about obsolete (not used) labels 8-)

I think you might see only 1 question on exam testing 2 dimensional loops, and I doubt you will see abandoned labels, these do not make sense.

So, the answer is: no, you won't see code like that with abandoned labels.