Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Method Overloading  RSS feed

 
Mukul Anand
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One small doubt.


My doubt is : Since the meth() in class B is an overload, do we still have the superclass version of meth() in the subclass B??
Put another way, does B have both versions of meth() in it ?
 
Henry Wong
author
Sheriff
Posts: 22835
119
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mukul Anand wrote:One small doubt.


My doubt is : Since the meth() in class B is an overload, do we still have the superclass version of meth() in the subclass B??
Put another way, does B have both versions of meth() in it ?



How about writing a program to test it? It only takes a few minutes.

Henry
 
Mukul Anand
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yeah. But writing a program to test it will just give me a straight yes or no.
I want to know the theoretical reason behind it.
 
rohit chavan
Ranch Hand
Posts: 133
Hibernate Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ok, first thing first.

What did you get? a YES or a NO?
 
Campbell Ritchie
Sheriff
Posts: 53749
127
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First things first would mean going to the Java Language specification.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!