About Question com.enthuware.ets.scjp.v6.2.68

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

Moderator: admin

Post Reply
pushpull
Posts: 14
Joined: Thu May 14, 2015 3:25 pm
Contact:

About Question com.enthuware.ets.scjp.v6.2.68

Post by pushpull »

The second option looks like this:
It will print false only if it is executed as: java -DFLAG=false Testclass
And the class name is TestClass. So it's a bad answer mostly, because it just won't run.
The third option is (the correct):
It will print true if executed as: java -DFLAG=true TestClass
and the answer to this is
Boolean.valueOf() is case insensitive. So it will print true even if executed as: java -DFLAG=tRUe TestClass
But what does case sensitivity have with the answer? According to https://docs.oracle.com/javase/tutorial ... sprop.html
The other version of getProperty requires two String arguments: the first argument is the key to look up and the second argument is a default value to return if the key cannot be found or if it has no value.
and I think this is the most important information, because the value is being set in execution. So the default "false" won't be needed.

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

Re: About Question com.enthuware.ets.scjp.v6.2.68

Post by admin »

1. Yes, in should say TestClass instead of Testclass. It is still a wrong option.
2. Explanation to Option 2 already talks about the getProperty method. It is quite straight forward, without much complication. Explanation to option 3 adds to that by giving you information about the case sensitivity of valueOf method. The option itself doesn't require this information. This is additional information that is important for the exam because there are questions in the exam that require you to know this.

Please remember that it is not book, so it is not possible to provide all the information with all the questions. But if you go through all the questions, you will see that everything that is important for the exam has been covered.

HTH,
Paul.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests