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 / shereef.k

It is neither Overloading nor Overriding , because these two methods are defined in two different class, and it can make overlaoding when class B extends Class A. It can never make Overriding because the parameter list in two methods are different.

Is This Answer Correct ?    9 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

there are N number of matchboxes numbered 1...N.each matchbox contain various number of stick.Two player can alternatevely pick some amount of stick from the higest stick containing box . The player is condidered win if there is no stick after his move.Find the final move so that the move player win. Note:In case the number of stick is equal ,pick the stick from the higest numbered box.

1784


What is binary search in java?

794


Why does java have two ways to create child threads? Which way is better?

802


What is data member in java?

687


Explain numeric promotion?

819


How do you sort words in java?

729


How variables are stored in memory?

730


How many return statement are allowed in a function?

660


When should a function throw an exception?

827


How would you dynamically allocate memory to an array?

803


When will we use them?

816


How does regex work?

740


Why 1 is not a prime number?

789


What are the differences between graph and tree?

875


What are identifiers in java?

794