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

What is == and === in javascript?

561


What is close method? How it's different from Finalize & Dispose?

566


What access modifiers can be used for class ?

544


How we can run a jar file through command prompt in java?

524


What do you mean by Hash Map and Hash Table?

606






What is bubble sort in java?

619


What happens when heap memory is full?

528


Which software is used for java programming?

559


What is string syntax?

551


Can you sort a list in java?

531


What is the latest version of java?

587


How will you communicate between two applets?

632


Is passing by reference faster?

523


What is Major and importance difference between for and foreach loop ?

575


In which order the iterator iterates over collection?

585