aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes abstract class implements 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 "abstract class implements interface" Watch "abstract class implements interface" New topic
Author

abstract class implements interface

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689


here SuperTest is implementing inter but not implementing the method g()
it compiles?

why?
if some one is implementing an interface then it is a rule to implement all the methods which are declared in interface?
why it compiles here


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Rajah Nagur
Ranch Hand

Joined: Nov 06, 2002
Posts: 239
Originally posted by saikrishna cinux:

if some one is implementing an interface then it is a rule to implement all the methods which are declared in interface?
why it compiles here


You missed a little bit from the above rule, if some one is implementing an interface then it is a rule to implement all the methods which are declared in interface unless it is declared as abstract

Please refer Sun tutorial.


You can't wake a person who is <b><i>pretending</i></b> to be asleep.<br />Like what <b>"it"</b> does not like - <i> Gurdjieff </i>
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  16

Moreover, a class extending your abstract will have to implement the g() method.

An abstract class cannot be instanciated, so there's no need to implement any interface methods. This is the role of a concrete class.
[ July 18, 2006: Message edited by: Satou kurinosuke ]

[My Blog]
All roads lead to JavaRanch
 
wood burning stoves
 
subject: abstract class implements interface