Thomas Roth

Greenhorn
+ Follow
since Feb 21, 2017
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Thomas Roth

Thank you Eric for your honest post and congratulations for passing your exam.
It is similar situation for me with longer break times because of work and private distractions (i have not passed the 17 exam yet).
I am java 6 and 8 certified, then failed for the java 11 exam two times.
Right now i am studying for the 17 exam, although i am a bit dissapointed about how it is going.

My opinion about the Oracle java certification is that i get more and more disillusioned because for me it is obvious that only very few pass it without the enthuware 'cheat' tests.
Why do i write 'cheat' ? Well even if Enthuware guys or whoever says it is only similar, i think it is often enough nearly the same or very close to identical questions.
Don't get me wrong, i dont blame anyone for using enthuware or any mock tests at all, i blame the exam creators because in the end it all gets more and more based on a lie.

What is the aim for this whole certification process ? Well it is to 'prove' that someone who passed has a very good knowledge of the Java language it says. And that companys have a metric to compare workers maybe ?
Shouldn't it be that with a good understanding it should be possible to pass the exam without having memorized questions from mock exams ?
At least this is my opinion.

Don't belive me ? Then Oracle could do an anonymous poll where people answer honestly if they passed and if so, if it was without mock exam questions.
The percentage of people passing the exam without enthuware or similar will be below 5% for sure. So what is the point ? Knowledge of Java or be able to proof you have above average memory to remember the slightest details so you don't fall for the silly 'don't compile' answers ?

Once is was enthusiastic about java certification. I still think the idea is great, but if the Exam creators don't change direction i think it will loose relevance, at least here in germany.

Which brings me to my critics about the exam topic itself.
Proving good knowledge of the Java language is nice, but it should stay 'on earth' with what industry needs.
No Boss is interested in Java certificated people which prooved maybe only they memorized mock exam questions or know the finest details which is just not that relevant on the job.

In Germany most companys use Java and Spring Framework as a defacto standard. I work as consultant/developer, have been in many projects so i think i have a picture.
4-5 questions about module system ? Is it really such a big thing in the states ? Nobody, and i mean it literally, NOBODY uses this here in germany.
The customer i work for right now has dozens of applications with hundreds of classes. Multi module maven or grade builds. Do you really think anybody wants to edit files with export statements ? Ridiculous.
This feature is the most overrated from Oracle since the birth of Java, i don't know, maybe someone has to come here and explain the advantages and why it is worth the maintainance of module files.
Also the questions with 'doesn't compile' are ridiculous in my opinion, there is much argue about that i know. But why not asking questions like 'Why does this not compile ?' It is possible to proove your Java skills without this trick questions. This misses the mark regarding what industry is looking for.

@Eric sorry for this drifting away in my resposne. Your post just triggered my feeling about the certification in general ;)
While working through the book i came to chapter 6, question 11 which i answered wrong.
In the Appendix Review Question for this 11th question it states on page 929 "...Remember, a static main() method can access private constructors declared in the same class. ..."

This explanation came out of the blue for me. I could be wrong but even after browsing back and forth i could not find a single sentence which explains this.
So this "Remember" is either wrong and it should be explained in one of the chapters before, or i am just blind and can not find the corresponding section.
Could anyone with the book please double check and confirm if my asumption is right or point me to the quote where it is explained ?

Thank you and best regards

Campbell Ritchie wrote:

Thomas Roth wrote:. . . Array would be . . . when it is inserted. . . .

What array? You cannot insert elements into an array because its size is fixed. I presume you mean a List of some sort. Please be careful about nomenclature.



No i meant array. It is about the sort and binarySearch function and the "inserted" was meant in the book just to describe where the string would have been if the array before would have been initialized with it.
Thats basically in some way what Arrays.binarySearch returns. And that is what it was all about in the book and description.

Stephan van Hulst wrote:I don't have the book in question, but could it be that before insertion, "pig" is referred to as "second element" because "123" might be referred to as "zeroth element"?

Remember, arrays in Java are 0-based.



That came also to my mind, but then it would be better to talk about index i think. So zeroth index is the first element. There is no zeroth element. It is just wording you could argue but here it should be more precise.
Hello,

on page 923 answer for question 15 chapter 4 it says: "The binarySearch() method looks at where a value would be inserted, which is before SECOND element for Pippa."

I think it should state AFTER second element (or before third element).

Array would be {"123", "PIG", "PIPPA", "pig"} when it is inserted.

The correct answers C, E are correct anyways.

Stephan van Hulst wrote:The way Java performs type inference on lambda expressions is very complex and will take a long time to explain. The short answer is that in the first case, you explicitly told the compiler to use the length() method of the String class, while in the second case, the compiler has to infer that you want to use the String class. Part of the reason why the compiler is not able to infer that you want to use String, is because comparing() takes a generic type with a parameter that has a lower bound. So when you write Comparator.comparing(s -> s.length()), the compiler interprets that as Comparator.comparing((Object s) -> s.length()). As you know, Object doesn't have a length() method. The compiler does not look at the surrounding method call to provide the comparing() method with more context.

You can fix this by explicitly stating the type of the lambda argument, or by passing the generic type arguments to the comparing() method explicitly:



Thank you very much Stephan, that was a very good explanation and helped me to understand what is going on there. ;)
Hi folks,

i need help with following situation:

List<String> list = Arrays.asList(
               "Bob", "Sarah", "Marcus","Leander","Thomas");


I just can not understand why this works:



while this does NOT work:




I know it must have something to do with the method references, but i just cant figure it out.

Similar problem, why does this then work:


but if i write for com1 the "Comparator.comparing(s->s.length())" in the sorted() it again wont work. ?

Any help would be appreciated
I have a question about the table on page 33.

In the first column for "Member inner class" it says "Can access local variables of enclosing class" -> No

Is this right ? Because if i understand it right i would say it can access.

For example the inner class can access "bla" which is a local variable:

Jeanne Boyarsky wrote:No. Oracle has a disclaimer that you should assume the necessary context:

Code fragments: A code fragment is a small section of source code that is presented without its context. Assume that all necessary supporting code exists and that the supporting environment fully supports the correct compilation and execution of the code shown and its omitted environment.



This means if the code isn't in a method, you can assume it declares any checked exceptions. You will see this technique on the real exam too so glad it came up here!



Puh, thank you very much Jeanne, i would have missed that in the exam. Really glad it came up here too
So, if no method is shown, all exception handling is done. Good to know! Thank you.
It is similar to some other erratas i found.

Answer must be B,D because there is also an unhandled IO-Exception from Files.readAttributes() in line 2 of the code snippet.
With this handled, the answer would be only D like it tells.
The code snippet will not compile because "Files.deleteIfExists(path) has an unhandled IO-exception.
So the correct answer would be F, NOT B,C
I think all answers are wrong, because the code does not compile, it has an unhandled IO-Exception with Files.newdirectoryStream(Path)
At least in my IDE, so i think all of possible answers are wrong.
The answer for Question 13 is correct. It is a SQL Exception.
Merely the answer is a little misleading.
It says: "This means that rs is no longer open by the println, and an SQL Exception is thrown because...."
For a second edition i would write that "This means that rs is no longer open by the rs.next() command..." because this is the line which causes the exception before the println().
Hello,

the answer to question 11 says "B,D,E. You need to memorize the contents of Table 6.2 and Table 6.3 before the exam".

This is correct for the print test on page 320. But in the online test the question has a different Answer A.
There it says "A. IllegalFormatException" which is a runtime exception and should be marked in the online answer.
But the answer online says its wrong becaus it tells above result.