• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Method Overloading

 
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
Marshal
Pie
Posts: 21008
77
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: 132
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: 48652
56
  • 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