I can not understand why dont print
goodgood bye friend!
1st interation: goodgood
2nd: bye
3rd: friend
Doesn't make sense?
About Question enthuware.ocajp.i.v7.2.1258 :
Moderator: admin
-
- Site Admin
- Posts: 10326
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1258 :
Why do you think first iteration will print "goodgood"?
If you like our products and services, please help us by posting your review here.
-
- Posts: 1
- Joined: Wed Oct 16, 2013 12:54 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1258 :
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).
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).
-
- Site Admin
- Posts: 10326
- Joined: Fri Sep 10, 2010 9:26 pm
- Contact:
Re: About Question enthuware.ocajp.i.v7.2.1258 :
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.
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.
Who is online
Users browsing this forum: No registered users and 6 guests