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

Why do we use bufferedreader?

1051


Is a class subclass of itself?

1126


Which class is the superclass for all the classes?

1062


What is thread life cycle?

1030


What is method in java ?

1142


Explain the difference between an Interface and an Abstract class?

1227


What is hotjava?

1066


What is argument in java?

1055


What exactly is a .class file?

1097


What is null mean in java?

1149


How do generics work?

997


How to sort numbers in java without array?

1039


Can we access the non-final local variable, inside the local inner class?

1079


What is the similarity between dynamic binding and linking?

1165


How can u increase the heap size in the memory?

1067