About Question enthuware.ocpjp.ii.v11.2.3309 :

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

Moderator: admin

Post Reply
teodorj
Posts: 28
Joined: Tue Jun 19, 2018 10:27 am
Contact:

About Question enthuware.ocpjp.ii.v11.2.3309 :

Post by teodorj »

This is a good approach to exception handling because it can handle new exceptions without affecting caller code.
I did not choose this option because java.rmi.ServerException is a checked exception (because of throws) so caller must handle or declare it

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

Re: About Question enthuware.ocpjp.ii.v11.2.3309 :

Post by admin »

Yes, but the method already has "throws ServerException" clause. So, any existing client is already dealing with it. You can change the method code to anything and the resulting exception will be wrapped inside a ServerException. No change for the client.

teodorj
Posts: 28
Joined: Tue Jun 19, 2018 10:27 am
Contact:

Re: About Question enthuware.ocpjp.ii.v11.2.3309 :

Post by teodorj »

Got it. Thanks :)

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 4 guests