About Question enthuware.ocajp.i.v7.2.1258 :

Help and support on OCA OCP Java Programmer Certification Questions
1Z0-808, 1Z0-809, 1Z0-815, 1Z0-816, 1Z0-817

Moderator: admin

Post Reply
renatumb

About Question enthuware.ocajp.i.v7.2.1258 :

Post by renatumb »

I can not understand why dont print
goodgood bye friend!

1st interation: goodgood
2nd: bye
3rd: friend

Doesn't make sense?

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1258 :

Post by admin »

Why do you think first iteration will print "goodgood"?
If you like our products and services, please help us by posting your review here.

JavaDev4711
Posts: 1
Joined: Wed Oct 16, 2013 12:54 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1258 :

Post by JavaDev4711 »

Guess, because he/she thought that : binds more than +, resulting in
i == 0 ? args : " " --> "good" for 0, THEN adding args again --> "good" + "good", while having " " + args for the other i values.

What I missed was that "java Test good bye friend!" was the whole command, not just the arguments. So "none of the above" was obvious to me. Being a killjoy, I could rename the java.exe, so the command would result in "none of the above". Does this make sense?

I guess the test exam questions are just the same style as the real questions, so I don't want to blame Enthuware. To me, many of the questions are obsolete due to IDEs and Google. I want to fly to Mars (solve the question using my knowledge about the conditional and the + operator), but I am forced to discuss the color of the rocket (see that "java Test" is the command at command line and only "good bye friend!" are the arguments).

admin
Site Admin
Posts: 10036
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v7.2.1258 :

Post by admin »

Hello,
It is true that a lot of things are taken care of the IDEs. But this being the first level of certification, you are expected to compile and run the programs from command line using javac and java, without the help of IDEs.
Regarding the confusion about the command line, the question does say the code is run using the command "java Test good bye friend!".

Yes, you could rename java.exe to something else, but that is not really relevant for the exam :) You will need to assume basic things unless specified explicitly in the question. So here, you can safely assume that java is standard java.exe that is used to run a program from the command line.

HTH,
Paul.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 33 guests