• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

abstract class implements interface

 
Ranch Hand
Posts: 689
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 239
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 ]
 
We're all out of roofs. But we still have tiny ads:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic