• 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
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

Abstract method or Interface method ??

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I'm cannot understand this situation in abstract methods and interface method.

let say, there is a interface 'Test' and abstract class Info



Following class extends Info and implements Test.
Can anyone explain me which load() method is implemented ??



As code compiled and run, it seems that interface load method is implemented. but how??
What happen to the abstract class method ??

Regards,
Dil.
 
MyExamCloud Support
Posts: 267
5
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Dilan alex,

As your method signature (name, parameters and return values) are same in interface and abstract class, the implementation in concrete class is common.

How can you say interface load() method is implemented?

The implementation is common to both Test and Info.



 
Ranch Hand
Posts: 384
MyEclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


that doesn't seems to be problem .

you are providing the implementation of a method from abstract class in a subclass .
you are providing the implementation of a method from interface as well

the coincidence is the signature of both method is same so what it shouldn't be the matter of compiling to the JVM.




naveen
 
reply
    Bookmark Topic Watch Topic
  • New Topic