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

Explain java code for recursive solution's base case?

1007


What is the common usage of serialization? What exceptions occur during serialization?

1096


can java object be locked down for exclusive use by a given thread? : Java thread

1073


What is an object's lock and which object's have locks in java programming?

1030


How we can execute any code even before main method?

1116


What about anonymous inner classes in java?

1012


Write a code to show a static variable?

1075


What is try-with-resources in java?

1142


What do you understand by the term string pool?

989


explain the concept of virtual method invocation in polymorphism in detail?

2204


What is string value?

1137


What is the properties class in java programming?

983


Can a boolean be null java?

957


Define nashorn in java8.

1024


What are the advantages of java over C++?

1185