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 / souvik

The answer will be first option B since the object created is of B type and it is calling directly the process method in B class

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference between null and void?

909


How to call one constructor from the other constructor ?

983


How do you replace all in word?

986


What are byte codes?

1131


What are kinds of processors?

933


Explain the significance of class loaders in bootstrap?

888


Is java code slower than native code?

1001


Is math an abstract class in java?

945


What is the main use of generics in java?

915


Can java object be locked down for exclusive use by a given thread?

947


Which is bigger double or float?

908


What restrictions are placed on method overriding in java programming?

932


What is meant by polymorphism?

956


If a method is declared as protected, where may the method be accessed?

959


Can we extend singleton class?

897