• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

A question on a concrete class implementing interface

 
Ranch Hand
Posts: 59
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Ranch Hand
Posts: 333
Firefox Browser Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Leave them for Exception handling chapter Okay ?? GOOD BYE
 
Lorraine Batol
Ranch Hand
Posts: 59
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Atleast expound on number (5). It may declare runtime exceptions on any interface method implementation regardless of the interface declaration. (5)
 
Ranch Hand
Posts: 67
Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.


 
reply
    Bookmark Topic Watch Topic
  • New Topic