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 constructor and how many types of constructors are used in java?
What is finalize method?
What is singletonlist in java?
When parseint method can be used?
What is the biggest integer?
What is string and its types?
Does isempty check for null?
What is meant by the value of a variable?
What is vector capacity in java?
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?
What is meant by string is immutable?
What is another word for methodology?
Print Vertical traversal of a Binary Tree.
What is the meaning of variables in research?
What is the significance of continue jump statement? Explain with an example.