Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

About interfaces and inheritance

 
Andry Dub
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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");
}
}
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15438
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Andry Dub
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 424
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1324
Android Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Andry Dub:
But on the exam I will not be able to use a compiller!


but concepts & practices.
 
Andry Dub
Ranch Hand
Posts: 43
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much! I will take your advice!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic