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 is the applet security manager, and what does it provide?
Why string is called as immutable?
What are the two ways of implementing multi-threading in java?
Explain jvm, jre, and jdk?
What will happen to the exception object after exception handling?
How do you define a parameter?
What is the concept of multithreading?
What are the 4 versions of java?
How do I start learning java?
What is the difference between method overriding and overloading?
How do you add an arraylist to an array in java?
Can we override the static methods?
What carriage return means?
What is the abstract class?
Does sprintf allocate memory?