Is it possible to do method overloading and overriding at a
time
Answer Posted / sathishkumar.m
class A
{
int c;
void add()
{
System.out.println("hai");
}
void add(int b)
{
c=b;
System.out.println("value of b:"+c);
}
}
class B
{
int e;
void add(int d)
{
System.out.println("value of d:"+e);
}
}
class Demo
{
public static void main(String aa[])
{
A o1=new B();
o1.add();
}
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
what is the major difference between linkedlist and arraylist in java?
Can arraylist hold different types java?
what are the methods in object?
What are different types of references?
Why is singleton not thread safe?
Java is pass by value or pass by reference? Explain
What is mean by encoding?
What is anonymous inner class?
What do you mean by garbage collection used in java?
How many functional interfaces does java 8 have?
What is r in java?
What is static variable with example?
What is meant by overloading?
What are peerless components?
How many types of string data types are there?