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 are methods?

962


What is the use of static class?

1081


Does the order of public and static declaration matter in main method?

1028


What is a control variable example?

950


What does flagged out mean?

1000


What is the difference between Grid and Gridbaglayout?

1136


Why unicode is important?

891


What is the purpose of javac exe?

1023


Can we create an object if a class doesn't have any constructor ( not even the default provided by constructor ) ?

1023


What is meant by structural programming?

965


How do you check whether the list is empty or not in java?

920


Can we use synchronized block for primitives?

1012


What is bifunction in java?

1114


Why is a constant variable important?

893


Can variables be used in java without initialization?

1019