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 are the problems faced by java programmers who don't use layout managers?
What is tcp and udp?
How do you clear a method in java?
What is the difference between logical data independence and physical data independence?
'A class is a template for an object' explain this statement.
What is sorting in java?
Given a singly linked list, how will you print out its contents in the reverse order? Can you do it with consuming any extra space?
What is equals method in java?
What is singleton service?
How do you reverse sort a list in java?
Difference between java and javascript
What does split function do in java?
What two classes are used to read data only?
How do I convert a numeric ip address like 192.18.97.39 into a hostname like java.sun.com?
What are different ways of object creation in java ?