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

Given a singly linked list, determine whether it contains a loop or not without using temporary space?

1034


Explain the usage of this with constructors?

1073


How to do a true java ping from windows?

1243


What is the use of generics? When was it added to the Java development Kit?

1071


What is the difference between length and size in java?

1035


What is the transient keyword?

2354


What is the difference between an argument and a parameter?

1046


What are the different types of data structures in java?

1035


What is the difference between state-based unit testing and interaction-based unit testing?

992


What is factor r?

1014


Explain about instanceof operator in java?

1123


What is ascii format?

1036


What is a package in java? List down various advantages of packages.

1351


What is an iterator java?

1205


Explain the difference between collection api and stream api in java8?

1031