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 replaceall in java?
Which variable is the independent variable?
Can we overload destructor in java?
How do you delete a list in java?
Can It is possible to synchronize the constructor of a Java Class?
What do you know about the garbage collector?
How will you add panel to a frame?
What is an object’s lock and which object’s have locks?
What are parameters in a method?
What is the difference between break and continue statements?
What do you understand by the term polymorphism?
what is a thread pool in java and why is it used?
What is the benefit of using enum to declare a constant?
What is the difference between JVM and JRE?
Explain different ways of creating a thread?