File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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: 18840
    
  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: 132

ok, first thing first.

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

Joined: Oct 13, 2005
Posts: 38851
    
  23
First things first would mean going to the Java Language specification.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Method Overloading