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

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

Moderator: admin

Post Reply
Daniel Clinton
Posts: 29
Joined: Fri Aug 08, 2014 11:22 am
Contact:

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

Post by Daniel Clinton »

The type MySpecialException is not declared.
This code doesn't compile.

Exception in thread "main" java.lang.Error: Unresolved compilation problem:
MySpecialException cannot be resolved to a type

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

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

Post by admin »

The question says, "(Assume that MySpecialException is an unchecked exception.)". So you need to assume that it exists.
To make it compile, you can add the following code:
class MySpecialException extends RuntimeException{}

Daniel Clinton
Posts: 29
Joined: Fri Aug 08, 2014 11:22 am
Contact:

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

Post by Daniel Clinton »

It doesn't say this in the question. It's missing.
Shall I email a screenshot?

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

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

Post by admin »

It was fixed only a few days ago. Please redownload the ets file from our website.

Daniel Clinton
Posts: 29
Joined: Fri Aug 08, 2014 11:22 am
Contact:

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

Post by Daniel Clinton »

Got it thanks!
:) Was using the test software so much
that I never restarted it
so didn't catch the bank update notification

Thanks very much for taking the time to respond so quickly to each post
This product+forum is very helpful indeed
Cheers guys

jadam81
Posts: 2
Joined: Sun Aug 02, 2015 3:54 pm
Contact:

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

Post by jadam81 »

Wouldn't this method require a throws statement to work? I had chose it would not compile based on that.


16.    static void doSomethingElse() {
17.        throw new MySpecialException("Sorry, can't do something else");
18.    }

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

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

Post by admin »

No, there is no need for a throws statement because the question says that MyException is an unchecked exception.

Post Reply

Who is online

Users browsing this forum: No registered users and 16 guests