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
Which methods cannot be overridden in java?
What does 3 dots mean in java?
Does garbage collection occur in permanent generation space in jvm?
What data type is a string?
I am a fresher and know core java, c languge, html, css etc if I am illegible for any job then send it on my email tatranakshay276@gmail.com
Explain about version control?
Which class is the superclass of all classes?
What an i/o filter in java programming?
Can It is possible to synchronize the constructor of a Java Class?
What are different data structures in java?
Explain different ways of creating a thread?
What is the difference between serializable and externalizable interface?
How garbage collection is done in java?
Does printwriter create a file?
Explain scope or life time of local variables in java?