File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

abstract class implements interface

 
saikrishna cinux
Ranch Hand
Posts: 689
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


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
 
Rajah Nagur
Ranch Hand
Posts: 239
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 ]
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic