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


Please Help Members By Posting Answers For Below Questions

what is the constructor and how many types of constructors are used in java?

537


What is finalize method?

580


What is singletonlist in java?

507


When parseint method can be used?

542


What is the biggest integer?

554






What is string and its types?

612


Does isempty check for null?

561


What is meant by the value of a variable?

462


What is vector capacity in java?

600


I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?

524


What is meant by string is immutable?

519


What is another word for methodology?

521


Print Vertical traversal of a Binary Tree.

611


What is the meaning of variables in research?

533


What is the significance of continue jump statement? Explain with an example.

741