shashi prakash agnihotri


{ City } 145
< Country > india
* Profession * student
User No # 68685
Total Questions Posted # 0
Total Answers Posted # 1

Total Answers Posted for My Questions # 0
Total Views for My Questions # 0

Users Marked my Answers as Correct # 19
Users Marked my Answers as Wrong # 0
Questions / { shashi prakash agnihotri }
Questions Answers Category Views Company eMail




Answers / { shashi prakash agnihotri }

Question { L&T, 7781 }

Is it possible to do method overloading and overriding at a
time


Answer

Yes, Is it possible to do method overloading and overriding at a
time

***********************************************


class A
{
void Add(int x, int y)
{
System.out.println("Hello From Class A" + (x+y));

}
}
class B extends A
{
void Add(int x, int y)
{
System.out.println("Hello From Class B" + (x+y));

}
void Add(double x, double y)
{
System.out.println("Hello From Class B" + (x+y));

}

}
class Test
{
public static void main(String ar[])
{
B acv = new B();
acv.Add(100.0,20.0);
acv.Add(10,20);
}
}

Is This Answer Correct ?    19 Yes 0 No