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 a parameter example?
Why java doesn’t support multiple inheritances?
How do you reverse sort in java?
Why heap memory is called heap?
How static variable work in java?
What are the differences between forwarding () method and sendredirect() methods?
What is the function of compareto in java?
Can you achieve runtime polymorphism by data members?
What does provide mean construction?
What is predicate in java?
What does the ‘static’ keyword mean? Is it possible to override private or static method in java?
What is the use of a conditional inclusion statement in Java ?
What is the difference between iterator and list iterator?
How can the checkbox class be used to create a radio button?
Explain about static nested classes in java?