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 meant by singleton class?

598


Is array serializable java?

515


What is the use of singleton?

509


Explain all java features with real time examples

1204


how we can use debug in myeclipse 6.0 in order solve the problems that exist in our program when there are 900 to 1000 pages in a web application

1663






Can you start a thread twice in Java?

629


Differentiate between array list and vector in java.

630


What is a nonetype?

559


How do you square a number?

576


If try block is successfully executed, Then Is Finally block executed?

606


what is function overloading in java?

697


Howto get an object that will perform date & time calculations then format it for output in some different locales with different date style.can ne1 tel me the answer of this question.pls

1444


What is time complexity java?

532


I want to re-reach and use an object once it has been garbage collected. How it's possible?

533


What is nextint java?

543