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 / r.jainrocks@gmail.com

Compilation fails

static keyword not allowed here
at line 11 and 14

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can we make main() thread as daemon?

1031


What is the Difference between Final Class && Abstract Class?

1025


Can you start a thread twice in Java?

1059


Can we have any code between try and catch blocks?

927


Can we store variables in local blocks?

1304


Explain how to force the garbage collection in java.

923


Can inner class final?

1045


Does java have extension methods?

911


What is a method type?

939


What is a variable in java?

1031


I have multiple constructors defined in a class. Is it possible to call a constructor from another constructor’s body?

952


What is supplier in java?

951


I want my class to be developed in such a way that no other class (even derived class) can create its objects. How can I do so?

930


Is overriding possible in java?

900


What are java methods?

1034