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 does the term struts mean?

1037


What is actionmapping?

1116


How can we group related actions in one group in Struts?

1022


How exceptions are handled in struts application?

1209


What is the purpose of interceptors?

1052


Explain about struts relation to html tags?

1008


What does action do in struts?

1059


When do I need “struts.jar” on my classpath?

1030


Can we have multiple struts config files ?

1013


What is struts2 in java?

1114


What are different Struts2 tags? How can we use them?

1000


What steps are required to for an application migration from Struts1 to Struts2?

1086


What is controller in struts2?

1230


How do I access token?

1026


How struts 2 validation works?

1150