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 / abhijit ghosh
It is neither overriding nor overloading.
because class A and B are two different and independent
classes. So "disp" function for both are completely bound by
the scope of their respective classes or more to say to the
objects of respective classes. Therefor,
if aa and bb are two objects of class A and B respectively
then
aa.disp() and bb.disp()will be two distinct function of two
different objcts of different classes only.
| Is This Answer Correct ? | 30 Yes | 4 No |
Post New Answer View All Answers
Can you use abstract and final both with a method?
Difference between string, stringbuffer and stringbuilder?
What are jee technologies?
How hashset works internally in java?
Can we call the run() method instead of start()?
Explain inner classes ?
Is binary a low level language?
Does constructor return any value?
What is the main difference between java platform and other platforms?
What is a method vs function?
Why there are some null interface in JAVA? What does it mean? Give some null interface in JAVA?
How many ways can we create singleton class?
What is finally block?
Give me some null interfaces in java?
Can we have multiple classes in a single file?