my dog learned polymorphism
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: 20057
    
  44

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: 44028
    
  33
First things first would mean going to the Java Language specification.
 
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
 
subject: Method Overloading
 
jQuery in Action, 3rd edition