wood burning stoves 2.0*
The moose likes Java in General and the fly likes Method Overloading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Method Overloading " Watch "Method Overloading " New topic
Author

Method Overloading

Mukul Anand
Greenhorn

Joined: Nov 28, 2012
Posts: 29
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

Joined: Sep 28, 2004
Posts: 18497
    
  40

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


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Mukul Anand
Greenhorn

Joined: Nov 28, 2012
Posts: 29
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

Joined: Oct 08, 2010
Posts: 131

ok, first thing first.

What did you get? a YES or a NO?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 37884
    
  22
First things first would mean going to the Java Language specification.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Method Overloading
 
Similar Threads
doubt var arg
Doubts
Doubts
javabeat generics question doubt
Generics doubt