This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes deadly diamond of death syndrome :) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "deadly diamond of death syndrome :)" Watch "deadly diamond of death syndrome :)" New topic
Author

deadly diamond of death syndrome :)

Lucas Smith
Ranch Hand

Joined: Apr 20, 2009
Posts: 804
    
    1

Please, have a look:


The second one:


Compiler allows you to declare the common exception from within multiple interfaces. If the interfaces' exceptions are uncommon you will not be allowed to declare any checked exception.

I only wanted to figure this out.
Correct me if I am wrong.


SCJP6, SCWCD5, OCE:EJBD6.
BLOG: http://leakfromjavaheap.blogspot.com
Deepak Bala
Bartender

Joined: Feb 24, 2006
Posts: 6661
    
    5

That makes sense

For common exception hierarchies




If InterfaceC is allowed to throw IOException then a statement like InterfaceB ref = new SubClassThatThrowsIOExAndImplementsC(); will get into trouble since the Exception scope does not allow this. IOException is wider than FileNotFoundException and the InterfaceB contract only allows you to throw FileNotFoundException

So InterfaceC can only throw FileNotFoundException

For the scenario



InterfaceC is in trouble. For case



So InterfaceC cannot throw anything, since the contract provided by InterfaceA or InterfaceB can be broken

Does that make sense ?


SCJP 6 articles - SCJP 5/6 mock exams - More SCJP Mocks
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: deadly diamond of death syndrome :)