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

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

Moderator: admin

Post Reply
satar
Posts: 10
Joined: Tue Feb 12, 2013 9:12 pm
Contact:

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

Post by satar »

Struggled with this one because option one talks about "unexpected user inputs", which is when something out of the ordinary happens. Kind of think this one is a bit on the gray side.

baxhuli
Posts: 5
Joined: Wed Mar 27, 2013 11:57 am
Contact:

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

Post by baxhuli »

Till now I knew that Exceptions were there to make sure to make the program not to crash if smth unexpected happened and not just for "logging purposes". We can log unexpected user behaviors even through "if-else if-else" but there is no other mechanism to make the program not to crash if something goes wrong. I understand that this is what Oracle wants but it does not make much sense.

billclar
Posts: 2
Joined: Fri Dec 20, 2013 10:59 am
Contact:

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

Post by billclar »

This is a bit subjective as there are four correct answers.

Logging is a separate concept from Exceptions.
Unexpected user inputs are a reason for IllegalArgumentException.

FruityPebbles
Posts: 3
Joined: Fri Oct 03, 2014 2:29 pm
Contact:

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

Post by FruityPebbles »

I agree that the answers are somewhat subjective. You could make an argument for any of the given answers.

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

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

Post by admin »

Yes, it is a bit subjective and that is what the explanation says as well.
If you like our products and services, please help us by posting your review here.

olograph
Posts: 6
Joined: Mon Feb 01, 2016 3:13 pm
Contact:

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

Post by olograph »

The only reason this question would help is:
if you haven't been warned (100 times) already that some exam questions are going to be unclear­
or
if a question with very similar syntax would show up in the exam.

Otherwise, it (re-creating potential confusing sentences) is a waste of everyone's time.

NickWoodward
Posts: 29
Joined: Mon Mar 30, 2015 6:00 pm
Contact:

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

Post by NickWoodward »

its purpose is to recreate the exam. if that includes confusing or obscure statements, so be it.

redvee78
Posts: 2
Joined: Wed Jul 12, 2017 2:38 pm
Contact:

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

Post by redvee78 »

I understand what admin says about this question, but in my opinion it's a bad question. If the exam has such questions, then I personally value the exam less.

flex567
Posts: 202
Joined: Mon Apr 02, 2018 8:40 am
Contact:

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

Post by flex567 »

I don't understand why is this not correct:
that the VM uses to exit the program when something unexpected happens.
Based on exceptions the JVM closes the thread that is running the program. or?

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

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

Post by admin »

There may be multiple threads running inside a JVM. Terminating a thread doesn't mean shutting down the JVM.
If you like our products and services, please help us by posting your review here.

flex567
Posts: 202
Joined: Mon Apr 02, 2018 8:40 am
Contact:

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

Post by flex567 »

Ok but I still don't understand why this is not a correct option?
that the VM uses to exit the program when something unexpected happens.

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

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

Post by admin »

because that is not what happens. Java Exceptions is NOT a mechanism that the VM uses to exit the program when something unexpected happens.
If you like our products and services, please help us by posting your review here.

michaelrfarcasin
Posts: 13
Joined: Thu May 16, 2024 5:30 pm
Contact:

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

Post by michaelrfarcasin »

The explanation for why 3 isn't the correct answer is equally true for 2, i.e. "While it is possible to log unexpected behavior, in case of an exception, that is not what exceptions mechanism is meant for. Exceptions provide the means to separate the details of what to do when something out of the ordinary happens from the main logic of a program."

Based on this thread I see that the question is subjective. Why does this question exist then? Just to show us that the exam will screw with us and bring down our score?

More importantly, what can I do to correctly answer questions like this on the exam?

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

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

Post by admin »

To answer exam questions correctly, you need to toe the line given in Oracle's Exceptions lesson: https://docs.oracle.com/javase%2Ftutori ... index.html

You are fighting the question unnecessarily by splitting hair. That is not helpful for the exam. Logging unexpected behavior is perfectly valid usage of exceptions. Making sure the program keeps running is too vague.
If you like our products and services, please help us by posting your review here.

michaelrfarcasin
Posts: 13
Joined: Thu May 16, 2024 5:30 pm
Contact:

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

Post by michaelrfarcasin »

Indeed, I looked over Oracle's Exceptions lesson when I the answer explanation, and double-checked it just now, but I didn't find anywhere that it talked about logging as a usage for exceptions. Where is it?

What I did find was support for option 1, because the lesson specifically references dealing with unexpected user inputs in an example for checked exceptions:
"For example, suppose an application prompts a user for an input file name, then opens the file by passing the name to the constructor for java.io.FileReader. Normally, the user provides the name of an existing, readable file, so the construction of the FileReader object succeeds, and the execution of the application proceeds normally. But sometimes the user supplies the name of a nonexistent file, and the constructor throws java.io.FileNotFoundException. A well-written program will catch this exception and notify the user of the mistake, possibly prompting for a corrected file name." (https://docs.oracle.com/javase%2Ftutori ... clare.html)

On another note, when you say "making sure the program keeps running is too vague" - I'm afraid I don't understand what you mean. The example I just referenced also supports making sure the program keep running even if something unexpected happens. So why wouldn't that be the correct answer based on Oracle's lesson?

It seems like Oracle's Exceptions lesson supports options 1, 2, and 4, which doesn't match the accepted answer. So again, how can I get the right answer for this kind of question on the exam?

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

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

Post by admin »

After going through your points and the problem statement. I think you are right and this answer should be corrected. If you have to select only one option, "that you can use to determine what to do when something unexpected happens." should be the right answer. Otherwise, all other options (which basically describe specific uses cases) are also correct.
thank you for your feedback!
If you like our products and services, please help us by posting your review here.

michaelrfarcasin
Posts: 13
Joined: Thu May 16, 2024 5:30 pm
Contact:

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

Post by michaelrfarcasin »

Thanks. On a related note, I just took (and passed) the exam, and it did in fact have screwy things like questions that wouldn't compile (but all the answers assumed it would) or questions with no valid answers, so learning that Oracle will screw with us and bring down our score actually is a good lesson to learn.

oswegobay
Posts: 3
Joined: Sat May 04, 2024 11:43 pm
Contact:

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

Post by oswegobay »

michaelrfarcasin,
Did you leave those questions unanswered? Or you picked the answers randomly?
Congratulations on passing the exam! Which one was it?

michaelrfarcasin
Posts: 13
Joined: Thu May 16, 2024 5:30 pm
Contact:

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

Post by michaelrfarcasin »

oswegobay wrote:
Sat May 25, 2024 12:17 am
michaelrfarcasin,
Did you leave those questions unanswered? Or you picked the answers randomly?
Congratulations on passing the exam! Which one was it?
1Z0-808. I picked the answers that I thought would fit best if the question made sense. But the exam doesn't show what you got right, so I don't know if I got those right.

oswegobay
Posts: 3
Joined: Sat May 04, 2024 11:43 pm
Contact:

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

Post by oswegobay »

Thank you, michaelrfarcasin.

Post Reply

Who is online

Users browsing this forum: No registered users and 20 guests