Help coderanch get a
new server
by contributing to the fundraiser
    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
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

interface problem

 
Ranch Hand
Posts: 634
Eclipse IDE Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator



SCJP1.6 JAVA 6 CERTIFICATION Guide-310-065
by Katherine Sierra (Author), Bert Bates (Author)




how can a class change parameter type of a method or this is function overriding

 
Ranch Hand
Posts: 446
1
Eclipse IDE MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
this is not function overriding
this is called as function overloading
How to know whether a method is overloading method : -
  • The name of method is same as that of another method
  • The argument list must be different in overloading
  • The return can change but if only return type is changed, that is not a legal overload


  • Overriding : -
  • The method arguments list must be same
  • The return type should be same


  • here in this case
    the doIt method in class Electronic is overriding the doIT method in interface device
    and the doIt(int i ) method is overloading the method doIt in interface device
    hope this helps
    happy coding
     
    Bartender
    Posts: 2292
    3
    Eclipse IDE Spring Java
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Report post to moderator
    Let's continue this discussion here.
     
    Consider Paul's rocket mass heater.
      Bookmark Topic Watch Topic
    • New Topic