Jeff de Jong

Greenhorn
+ Follow
since Aug 27, 2019
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
5
Received in last 30 days
0
Total given
42
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Jeff de Jong

Hi all,

Gladly I can say that I passed the OCA exam yesterday with a score of 66%. I was aiming for the +70% but I'm still glad that I passed.

With no mathematical or IT background I started end of 2019 with the OCA Study Guide from Jeanne Boyarski and Scott Selikoff. Before that I started with Study Guide from Edward Finegan and Robert Ligouri but that was in my opinion to advanced for me to start with and switched to Sybex which is more reader-friendly for starters. I do have to say that I have some experience with PHP at an amateurlevel so I was already a little bit familiar with some basic develop structures from a hobby perspective.

Several years ago I just started from scratch with coding of PHP and created simple dynamic websites and never took the time to learn the fundamentals first. That's why I wanted to start to learn the basics first before start actually coding with Java.

I have to say in the beginning it was a steep learning path to grasp the Java language and I had many frustrating moments.
But somehow I got infected with Java and (still) really want to learn it. At some frustrating moments I took long walks with the dog (and of course my wife) and that really helped to try it afterwards again. Sometimes during the walks it cleared my mind and realized what I was doing wrong. (this all is beside a non-IT fulltime job in my free time)

Anyway I practiced a lot with the code snippets in the book and experimenting different scenario’s with that in command prompt as well with IDE.
I also watched all together several hours of tutorials from Durga on YouTube. Once you are a little bit used with his accent it are really great tutorials. i.e. 10 hours of exceptions really explains it very well for beginners.

All the additional stuff I learned I wrote down in the OCA Study Guide and added to the objective. So I used a lot of yellow markers and filled the empty spaces with my own additional text.

After 2 years of reading and practicing (at a normal pace) I finally purchased a Enthuware licence last September. That helped a lot to get used to the exam questions style and learned stuff like i.e. that toUpperCase returns a new String when there is really something converted and that is crucial to know when you are comparing Strings. (docs.oracle.com says: Returns:the String, converted to uppercase. Do they mean the String or a new String?)

About the first 20 questions of the exam where long pieces of code to read and to find out what was the problem or provided solutions. During my Enthuware practice I decided to mark and skip question when it was taking longer about 2 minutes. After 20 questions there where more questions that was easier to answer in the 2 minute time. So there is really a psychological aspect to put you under timepressure in the exam.
In my case there where a lot of questions about arrays and complex nested for loops (and combinations of that) and beside that about inheritance and extending classes questions and casting objects, overriding,overloading methods and constructors calls and variable scope where mostly the objectives I encountered in the questions that is timeconsuming. I think reading this kind of questions has to be a second nature and would advise to practise on that a lot to do it quick.

I really want to thank Jeanne Boyarski and Scott Selikoff for the great study book they wrote, for me it's almost some kind of a bible.

Finally I need some advise, with what or how, I can continue to learn the Java language. Because I think I don't have enough practical skills enough to start with OCP book (1Z0819) I want to improve the coding skills first. Some told me to create Java some applications to learn to code, but what kind of applications? Do you have suggestions?
Yes, I think I want to continue with OCP Java 11 Complete Study Guide and not with OCP Java 8 because I read that it could retire soon. Right? I really appreciate your advice in general to continue to learn Java.
Thanks in advance.
@Jeanne Boyarsky

You have added it to the errata under question 30 but it is in fact question 32.

Hi Philip,

That's too bad but don't get depressed about it, you can't get everything right the first time.

I'm also preparing for the exam so could you provide more insight into the exam? i.e. about the objectives in general and examples of the trickquestions you mentioned?
Do you failed on some specific objectives or something else?
What is your plan to prepare for the next exam?

Thanks...


Maybe they meant "table 2.2" instead of "question".
Thanks @TimHolloway for your reply.
What I meant is that after instantiation of the class
the constructor on line 11 is called and then at line 12 this(4)
directly calls the argument constructor from line 6, and when it's done it turns back to halfway the no-arg constructor on line 13 and runs the rest.
How does JVM knows that the first constructor didn't run completely?
Hi all,

As a result of this question, in Sybex OCA Practice test CH6Q10, I have a question about order of execution.
When a rewrite this in a test class I noticed that this(4) calls the argument constructor and then prints line 8
and returns to the argument constructor and executes from line 13.
Though I understand now I cannot connect this to the learn objective?
Can anyone help me with this?
Thanks.

10. Which line of code, inserted at line p1, causes the application to print 5?


A. this(4);
B. new Jump(4);
C. this(5);
D. rope = 4;

You suppose wrong. That is not what I meant.


😂😂

I'm sorry I'm still a beginner of Java 8 and didn't know that in Java 11 you can run it as a one-liner this way.
Now I do.
Thanks.

when running it from the main folder with

java testPackage/ImportTest.java



I suppose you mean:


The Udemy course you are taking is an exam preparation.
What did you use to learn the fundamentals?

My goal is also to take the exam but in I stopped to practise with making mock exam questions and trying to learn from exam only but started with learning from OCA Study Guide (Boyarsky and Selikoff) and practise with code in Command Prompt and Notepad and experimenting with code examples from the book.
For me it is helping me beter to understand the learning path so far.
I hope this will give you another insight to learn the objectives.

I think Junilu Lacar already has given the right answer to understand working with array's.
@Campbell Ritchie

Would you please help me so I can solve your challenge.
I am still a beginner and eager to learn but I am stuck.
Every notification on my phone I hope it is an update of this topic but unfortunately so far it isn't.
It is probaly very simple but I cannot connet it to a Java learn objective.

Thanks in advance.
@Campbell Ritchie

I'm still trying to solve your challenge and searching for few hours my conclusion is that it is not possible to get args[0] to be null.
If I do not provide any arguments on the command line, then the String array of main() method will be empty but never null.
Right?

I hope you will reveal you quiz question so I can learn from this.

I meant how can you get args[0] to be null


Without assigning it?
I'm afraid I have to say I don't know.

No, the first three operands are operands of &&. It is only after the &&s have been evaluated that the whole expression (as far as !false) becomes the left operand of the ?: operator.


Yes, thanks I understand now.

I presume the correct answr is A.


correct answer is A.

Little challenge: under what circumstances can the leftmost expression, with != null) evaluate to false.


I accept the challenge....see below code.

Yes, thanks Mike this has broken my tunnel vision.
The first three operands are a part of the ternary expression.
Hello everyone,

Can anyone help me to understand this piece of code from  OCA/OCP Java SE 8 Programmer Practice Tests CH3Q46.

46. Which of the following is not a possible result of executing the following application?

A. Nothing is printed.
B. The application throws an exception at runtime.
C. Go Outside is printed.
D. Stay Inside is printed.

When I compile and then run from command-line with java OutsideLogic sunny then it outputs "Go Outside".
When I do the same with another argument e.g. java OutsideLogic test then it outputs "Stay Inside".

I do not understand that the third and last operand of && is a ternary operator and outputs a String.
When I flip the ternary operator to the first or second operand of && then it produces an error.
e.g. System.out.print(!false ? "Go Outside" : "Stay Inside" && args[0]!=null && args[0].equals("sunny"));
or
System.out.print(args[0]!=null && args[0].equals("sunny") && "test");
error: bad operand types for binary operator '&&'

Please help to understand why the third operand of && is not a boolean and (can) outputs a String.
Thanks in advance.