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

How do I convert a string to an int in java?

1124


Can we restart a dead thread in java?

1049


What is meant by call by reference?

1087


What does s mean in regex?

1070


What are the practical benefits, if any, of importing a specific class rather than an entire package (e.g. Import java.net.* Versus import java.net.socket)?

1169


Does collectionutils isempty check for null?

1481


Can we overload the constructors?

1042


What are synchronized methods ?

1157


Explain the concept of hashtables?

1224


Is java good for beginners?

1058


Given a singly linked list, find the middle of the list in a single traversal without using temporary variable.

1101


Explain java heap space and garbage collection?

1131


Can we sort set in java?

1011


What is object-oriented programming?

1206


hr interview how many minutes asking question

2092