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

What is the declaration statement?

956


Can the garbage collection be forced by any means?

993


Write java program to reverse string without using api?

1067


Why arraylist is used in java?

1079


Compare Mutex and Semaphore in java.

1008


What do you understand by casting in java language?

1031


What is reverse function?

1140


What is the difference between object oriented programming language and object based programming language?

1020


What are sets in java?

952


Can an interface have a class?

1003


Why to use nested classes in java? (Or) what is the purpose of nested class in java?

1073


What is array sorting in java?

1064


Can list contain null in java?

1090


Is Java a dying language?

1090


Can arraylist contain null values?

1024