Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

what is the major difference between linkedlist and arraylist in java?

1293


Can arraylist hold different types java?

1038


what are the methods in object?

1205


What are different types of references?

1024


Why is singleton not thread safe?

1103


Java is pass by value or pass by reference? Explain

1030


What is mean by encoding?

1124


What is anonymous inner class?

1126


What do you mean by garbage collection used in java?

1120


How many functional interfaces does java 8 have?

1080


What is r in java?

1106


What is static variable with example?

1053


What is meant by overloading?

1121


What are peerless components?

1143


How many types of string data types are there?

1164