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
What is meant by singleton class?
Is array serializable java?
What is the use of singleton?
Explain all java features with real time examples
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
Can you start a thread twice in Java?
Differentiate between array list and vector in java.
What is a nonetype?
How do you square a number?
If try block is successfully executed, Then Is Finally block executed?
what is function overloading in java?
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
What is time complexity java?
I want to re-reach and use an object once it has been garbage collected. How it's possible?
What is nextint java?