Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

implements

 
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!
Is always necessary overriding alls methods of interface when it is implemented.
Thank you in advance.
 
Ranch Hand
Posts: 2120
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes it is. Unless your parent class provides implementations. In this case they will be inherited an it is not necessary.
As an exception there are some methods declared optional in the interfaces in java.util.Collection and Map
By the way Jordi, if you know Spanish there are some pages in http://usuarios.tripod.es/JoseBotella
with articles about the Java Virtual Machine and the constant poool. In the future I will be adding more articles on Collections/Map and inner classes.
There is as well a simple class file parser, there is an English version of this.
 
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes it is always necessary to provide the implementation for method if you implement an interface. The only case your are not required to do is to declare your class as an abstract class.
Regards
Muhammad Ali
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I was wondering whether a class that neither implements some of the methods in an interface nor inherits the same (the methods) from its superclass, will be treated an abstact class by default or do we have to specify it explicitly.
It'd be great if someone could clarify.
Thanks in advance
Shyam
[This message has been edited by Shyamsundar Gururaj (edited September 07, 2001).]
 
Ranch Hand
Posts: 280
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


I was wondering whether a class that neither implements some of the methods in an interface nor inherits the same (the methods) from its superclass, will be treated an abstact class by default or do we have to specify it explicitly.


A class MUST(else compiler error) be declared as abstract if:
1.it has even 1 method which is abstract
or
2.it extends from an abstract class but does not give implementation for all abstract method.
or
3.it implement an interface but does not give implementation for for all methods.
Hope this helps,
correct me if i am wrong
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Leena
 
I knew that guy would be trouble! Thanks tiny ad!
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic