About Question enthuware.ocajp.i.v8.2.1350 :

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

Moderator: admin

Post Reply
admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: About Question enthuware.ocajp.i.v8.2.1350 :

Post by admin »

Why do you think it is unreachable?
An unreachable statement causes compilation error. So even if you think it is unreachable, why do you think it will print trouble: null?
If you like our products and services, please help us by posting your review here.

Meghana
Posts: 29
Joined: Sun Feb 11, 2018 3:13 am
Contact:

Re: About Question enthuware.ocajp.i.v8.2.1350 :

Post by Meghana »

An unreachable statement causes compilation error.
Yes Yes :o
1. I thought it would print trouble:null because f is initialized to null outside the try block (and so is an instance field).
2. There were questions similar to this in the previous tests.. I don remember the q number, though; where the answer was "compile time error" I guess when we try to access a value from the catch block which was in try. The scenario might have been slightly different.

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

Re: About Question enthuware.ocajp.i.v8.2.1350 :

Post by admin »

If there is a compilation error, how will the program run to produce any output?
You really need to go through a good book before attempting mock questions.
If you like our products and services, please help us by posting your review here.

Meghana
Posts: 29
Joined: Sun Feb 11, 2018 3:13 am
Contact:

Re: About Question enthuware.ocajp.i.v8.2.1350 :

Post by Meghana »

I actually got your point. Thank you..!
And I have read Kathy Sierra's complete OCA syllabus! :)

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

Re: About Question enthuware.ocajp.i.v8.2.1350 :

Post by admin »

You might want to try the one by Jeanne Boyarsky or Mala Gupta.
If you like our products and services, please help us by posting your review here.

Meghana
Posts: 29
Joined: Sun Feb 11, 2018 3:13 am
Contact:

Re: About Question enthuware.ocajp.i.v8.2.1350 :

Post by Meghana »

Yupp yup. Thank you!

creigelde
Posts: 1
Joined: Tue Nov 26, 2019 12:29 am
Contact:

Re: About Question enthuware.ocajp.i.v8.2.1350 :

Post by creigelde »

It is a compile-time error if a statement cannot be executed because it is unreachable. This means that the control flow of your program can't get to that statement, but you assume that they would be. The compiler analyzes the flow, and reports these statements to you as error messages. It is a reliable indicators of logical error in your program.

When the compiler reports an unreachable statement, it typically points you to the statement. When that happens, you can follow the flow of control from top to bottom to discover why the statement can never be reached. There are quite strict rules when statements are reachable in java. These rules are design to be easily evaluated and not to be 100% accurate. It should prevent basic programming errors.

Post Reply

Who is online

Users browsing this forum: No registered users and 65 guests