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
How is a variable stored in memory?
In java how do we copy objects?
What is the difference between preemptive scheduling and time slicing?
What java ide should I use?
What is abstraction in java?
What are mutable classes?
What are different ways of object creation in java ?
What is a variable analysis?
How to set the permissions to a file in java?
What is functional interface in java?
What are the restrictions that are applied to the java static methods?
What is the difference between array and array list in java?
What is the meaning of I ++ in java?
a thread is runnable, how does that work? : Java thread
What data type is true or false?