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
What does 3 dots mean in java?
How you can force the garbage collection?
What are dot operator queries?
What is the final blank variable?
What are the two ways in which thread can be created?
how to create multithreaded program? Explain different ways of using thread? When a thread is created and started, what is its initial state? : Java thread
What is canonical name in java?
How is treeset implemented in java?
What is the difference between numeric and integer?
What is array size in java?
Does hashset allow duplicates in java?
Can we declare main () method as non static?
What is the diffrence between inner class and nested class?
What’s the difference between callable and runnable?
Explain the features of interfaces in java?