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

What is action support class in struts2?

1009


What is package name in struts xml?

1012


What is container struts2?

1002


What is the purpose of @customvalidator annotation?

998


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

974


How properties of a form are validated in Struts?

1061


What are the benefits of Struts framework?

1003


What is apache struts vulnerability?

938


What is struts2 in java?

1047


What is the different actions available in struts?

1016


What is the purpose of struct-config.xml in struct2?

984


Does apache tomcat use struts?

926


Why aren’t the struts tags maintained as part of the jakarta taglibs project ?

916


Are struts and shocks the same?

919


What is interceptor? And life cycle methods of interceptor?

1040