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 / esha prasad

Overriding:: It's not any two classes will do to study this
scnario, because overriding will come in a scenario
involving parent child relationship.



public class Parent{

public void sum(int a, int b)
{
System.out.println(a+b);
}
class Child extends Parent
{


public void sum(int a, int b)
{
System.out.println("Sum of the integers = "+a+b);
}
}

}

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


}

}

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the necessity of empty tag?

995


In which method of action class the business logic is executed?

977


What’s the difference between struts and espresso?

991


How an actionform bean is created?

968


What is the purpose of action tag in struts.xml?

1014


What is the purpose of global-forwards tag in struct-config.xml?

961


What do you mean by actionform?

973


What is the purpose of @results?

998


What is java struts?

922


What is difference between spring and struts?

930


What do you mean by the abstract package in struts2, and what is its utilization?

939


What is action class?

1011


What are the steps required for setting up validator framework in struts?

1012


Why we use struts over servlets?

1063


Why do we need mapdispatchtoprops?

865