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 do you mean by synchronized non access modifier?
Tell me about different OOPS concepts.
Which api is provided by java for operations on set of objects?
What is the maximum length of a url?
What is the arraylist in java?
What is printwriter in java?
What are the features of java?
What is a subsequence of a string?
Explain the importance of finally over return statement?
What is string english?
What is the best definition for data?
Is integer passed by reference in java?
What is the size of integer?
What is the difference between import java.util.date and java .util?
What are thread local variables?