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

Will it be called overriding if I do not change the
parameters or return type, instead throw a different
exception in the method signature.

Answer Posted / siva

public class MyOverriding {
int add(int a, int b)throws Exception{ //TRUE
return a+b;
}
}
class SubClass extends MyOverriding {
int add(int a, int b)throws NullPointerException{
return a+b;
}
}

//BELOW CODE IS GETTING COMPILER ERROR
public class MyOverriding {
int add(int a, int b)throws NullPointerException{
return a+b;
}
}
class SubClass extends MyOverriding {
int add(int a, int b)throws Exception{
return a+b;
}
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Which textcomponent method is used to set a textcomponent to the read-only state?

1062


What is the difference between the string and stringbuffer classes?

1034


Explain about RMI Architecture?

1025


What are the benefits of detached objects?

1008


What are the call back methods in entity bean?

1006


Name three component subclasses that support painting?

1016


What is a policy?

2241


Explain about local interfaces.

1001


What is colon_pkg_prefixes and what is its use?

2458


what is meant by JRMP?

2264


What are the different types of exception?

983


What is the difference between long.class and long.type?

998


Why use a datasource when you can directly specify a connection details? (in a J2EE application)

4168


Why won’t the jvm terminate when I close all the application windows?

1181


Are enterprise beans allowed to use thread.sleep()?

1099