GeeCON Prague 2014*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes A question on a concrete class  implementing interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "A question on a concrete class  implementing interface" Watch "A question on a concrete class  implementing interface" New topic
Author

A question on a concrete class implementing interface

Yin Stadfield
Ranch Hand

Joined: Oct 13, 2012
Posts: 43

This is written under the two-minute drill of the first chapter on SCJP 6 Sun Certified Java Programmer Study Guide by Kathy Sierra and Bert Bates:

A legal nonabstract implementing class has the following properties:
It provides concrete implementations for the interface's methods. (1)
It must follow all legal override rules for the methods it implements. (2)
It must not declare any new checked exceptions for an implementation method. (3)
It must not declare any checked exceptions that are broader than the exceptions declared in the interface method. (4)
It may declare runtime exceptions on any interface method implementation regardless of the interface declaration. (5)
It must maintain the exact signature (allowing for covariant returns) and return type of the methods it implements (but does not have to declare the exceptions of the interface). (6)

I've finished reading the Chapter 1, and after reading this two-minute drill, I'm positive that those that (3-6) are not discussed on Chapter 1 (I'm positive there's a chapter dedicated to this but not this chapter). Anyway, I just want to understand those things now so I thought I ask here. I would appreciate it if anyone can expound on item (2-6) (with/without examples would do). Thanks!
Enkita mody
Ranch Hand

Joined: Aug 06, 2012
Posts: 333

Leave them for Exception handling chapter Okay ?? GOOD BYE


OCA7
Yin Stadfield
Ranch Hand

Joined: Oct 13, 2012
Posts: 43

Atleast expound on number (5). It may declare runtime exceptions on any interface method implementation regardless of the interface declaration. (5)
Ankit Gareta
Ranch Hand

Joined: Mar 28, 2011
Posts: 67

Hi Yin, As you first read the exception chapter , at that time you will understand that things....

Yin Stadfield wrote:Atleast expound on number (5). It may declare runtime exceptions on any interface method implementation regardless of the interface declaration. (5)


That's says : You can declare any runtime exception , regardless you don't declare in your interface method.



OCPJP 6 (91%)
 
GeeCON Prague 2014
 
subject: A question on a concrete class implementing interface