Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

The following program is Overloading or Overriding?
public class PolymorphismEx {
public int sampleMethod(int a) {
return a;
}

public String sampleMethod(int a) {
return "Is it Overloading or Overriding???";
}
}

Answer Posted / hemanth

Its Neither Overloading nor overriding, Because for Overloading there should some Variation in argument list and for overriding the return type(if Primitive) should be same.
int method(int a)
{
}
String method(int a)
{
}
arguments should be different for overloading
return type should be same(if primitive) for overriding

so its improper which results in compile time error.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is meant by tab pans?

1212


What are the main differences between the java platform and other platforms?

1035


How infinite loop is declared?

1001


What is module in oop?

996


Which container method is used to cause a container to be laid out and redisplayed in java programming?

1091


What is strings in java?

1025


What is final method in java?

1005


What is a pattern what is an anti pattern?

946


Write java program to reverse string without using api?

1032


What is a finally block?

964


What is the exact difference in between Unicast and Multicast object? Where will it be used?

1038


Tell us something about an iterator.

938


Explain about static nested classes in java?

1050


Are strings immutable in java?

960


Why are lists ordered in java?

999