aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes About interfaces and inheritance Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "About interfaces and inheritance" Watch "About interfaces and inheritance" New topic
Author

About interfaces and inheritance

Andry Dub
Ranch Hand

Joined: Nov 06, 2007
Posts: 43
Hi! Will this compile?

class Sub extends SuperPup implements Interf2, Interf1{
public void m1() {
System.out.println("Hello from Sub");
}
}
interface Interf1{
void m1()throws SQLException;
}
interface Interf2{
void m1()throws IOException;
}
class SuperPup{
void m1()throws IOException {
System.out.println("Hello from SuperPup");
}
}


Java is my love
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14270
    
  21

Originally posted by Andry Dub:
Hi! Will this compile? ...

Why don't you try it yourself? If you do you'll have an answer much quicker than when you wait for someone to answer the question here.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Andry Dub
Ranch Hand

Joined: Nov 06, 2007
Posts: 43
But on the exam I will not be able to use a compiller!
[ November 06, 2007: Message edited by: Andry Dub ]
ahmed yehia
Ranch Hand

Joined: Apr 22, 2006
Posts: 424
Originally posted by Andry Dub:
But on the exam I will not be able to use a compiller!

Now its time to use it. Work out the code your- self, then use the Compiler to see if the result matches your guessing or not.
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1321

Originally posted by Andry Dub:
But on the exam I will not be able to use a compiller!


but concepts & practices.


Saifuddin..
[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Andry Dub
Ranch Hand

Joined: Nov 06, 2007
Posts: 43
Thank you very much! I will take your advice!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: About interfaces and inheritance