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...

explain method overridding method overloding with examples?

Answer Posted / zurreyab ahmad

Ovloding:in overloding case same method name and different
parameter and different return type
public class overlo {

public void add(int a, int b)
{
System.out.println(a+b);
}
public float add(float c, float d)
{
return c+d;
}
}

class main1
{
public static void main(String[] args) {


}

}
Overriding:: in overriding case the same method name and
same parameter and same return type and in overriding case
at least two class must have



public class overri {

public void add(int a, int b)
{
System.out.println(a+b);
}
class overri1
{


public void add(int a, int b)
{
System.out.println(a+b);
}
}}

class main1
{
public static void main(String[] args) {


}

}

Is This Answer Correct ?    7 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the benefits of Interceptors in Struts2?

1177


What is Struts2?

1072


What’s the difference between struts and turbine? What’s the difference between struts and espresso?

989


What is the apache struts vulnerability?

952


Which design pattern the interceptors in struts2 is based on?

924


Explain how to work with error tags?

1021


How we can controlled duplicate form submission in struts?

950


What is the purpose of @createifnull annotation annotation?

1043


What is front controller in struts?

998


Which model components are supported by Struts?

1032


What are the different kinds of actions in struts?

1045


Explain the difference between dispatchaction and lookupdispatchaction in struts?

6361


What is difference between struts1 and struts2?

921


Are struts and shocks the same?

912


What is the purpose of @emailvalidator?

984