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

11. static class A {
12. void process() throws Exception { throw new Exception();
}
13. }
14. static class B extends A {
15. void process() { System.out.println(”B”); }
16. }
17. public static void main(String[] args) {
18. new B().process();
19. }
What is the result?
1 B
2 The code runs with no output.
3 Compilation fails because of an error in
line 12.
4 Compilation fails because of an error in
line 15.

Answer Posted / manikandan [ gtec,vellore ]

Answer is 1)B because we directly calling a process method
in class B

Is This Answer Correct ?    5 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is .net better than java?

993


What is encapsulation in java?

1085


What is a buffer in java?

1012


What is the purpose of the enableevents() method?

1029


Is array size fixed in java?

968


What is the difference between hashmap and hashtable in java?

1102


Why do we use predicate in java?

1030


How do you use spaces in java?

976


When a lot of changes are required in data, which one should be a preference to be used? String or stringbuffer?

1228


What two classes are used to read data only?

1078


How do you format in java?

989


Can I use % with real numbers?

1004


What is the difference between checked exception and unchecked exception?

1002


What restrictions are placed on method overloading in java programming?

1039


Can a constructor be protected?

1070