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

class A{
some variables;
public void a()throws Excepion1,Exception2{....}
}
class B extends A{
variables...
public void a()throws E2,E3{.....}
}
Qns:
here override of methods occurs or not,ore else wil give
any compilation error or run properly..plz tell me briefly
whts happening with the above codes....

Answer Posted / anjan singh

while overriding, you must keep in mind that the exception
being thrown by overriding method(method in subclass)
should not throw a broader exception than what is already
thrown by method in super class. one exception is that, you
can always throw RuntimeException from method in subclass.

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how we can create packages in java?

951


Is c better than java?

951


What is struts in java?

1036


Why is java so popular?

1103


What is linked hashset and its features?

1050


What is not thread safe?

974


v-model life cycle

2033


what happens when a thread cannot acquire a lock on an object? : Java thread

1046


What is the major drawback of internal iteration over external iteration?

1017


What is object english?

1053


What is the difference between interface & abstract class?

1030


What is regex used for?

987


Compare java and python.

974


What is array command?

1168


When wait(), notify(), notifyall() methods are called does it releases the lock or holds the acquired lock?

997