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

class A
{
public void disp(int a,int b)
{
System.out.println("hai");
}
}
class B
{
public void disp(int a,int b,int c)
{
System.out.println("hai");
}
}

above program is overloading or overriding?

Answer Posted / pravallika

There is no relation between both the classes,so it is neither
overloading nor overriding.overloading and overriding means IS-A Relationship must be there in both the classes.
for ex:

class A
{
public void disp(int a,int b)
{
System.out.println("hai");
}
}
class B extends A
{
public void disp(int a,int b,int c)
{
System.out.println("hai");
}

}
the above program is overloading,because Is-A Relationship is available in both the classes.

Is This Answer Correct ?    11 Yes 5 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is import java util arraylist?

1127


What are the characteristics of Final,Finally and Finalize keywords.

1135


What is treeset in java?

953


What is the major advantage of external iteration over internal iteration?

1047


What is this () in java?

984


What are data structures in java?

927


What are void methods?

981


Can we create our own wrapper class in java?

928


Explain the importance of thread scheduler in java?

967


What is getkey () in java?

973


What are the types of collections in java?

1011


Do you know how to reverse string in java?

1098


Can inner class be public in java?

990


Why can't you declare a class as protected?

1072


Can we override constructor in java?

1054