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...

Is it possible to do method overloading and overriding at a
time

Answer Posted / shashi

Yes, Is it possible to do method overloading and overriding at a
time

***********************************************


class A
{
void Add(int x, int y)
{
System.out.println("Hello From Class A" + (x+y));

}
}
class B extends A
{
void Add(int x, int y)
{
System.out.println("Hello From Class B" + (x+y));

}
void Add(double x, double y)
{
System.out.println("Hello From Class B" + (x+y));

}

}
class Test
{
public static void main(String ar[])
{
B acv = new B();
acv.Add(100.0,20.0);
acv.Add(10,20);
}
}

Is This Answer Correct ?    19 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we clone singleton object?

1122


Explain the importance of finally block in java?

1021


What is the difference between Java Program Constructor and Java Program Method, What is the purpose of Java Program constructor Please Explain it Breafily?

1092


What is meant by oops concept in java?

1048


What is the difference in between cpp and java? Can u explain in detail?

1153


What is the difference between form & report?

1084


What is an infinite loop?

1335


How is string stored in java?

1117


Can bool be null?

1028


Can an unreferenced object be referenced again?

1244


How to implement a multithreaded applet?

2729


If a variable is declared as private, where may the variable be accessed?

1109


What is wrapper class html?

989


how to handle exceptions in ejb?

2362


how would you implement a thread pool? : Java thread

967