answersLogoWhite

0


Best Answer

All exception types are sub classes of the built-in class Throwable.

so at the top most position it is Throwable --- under this comes two branches Exception and Error.

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the top most class in Exceptions?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Describe the JAVA throwable class hierarchy and types of exceptions?

In Java there are two main types of Exceptions. * Checked Exceptions - The ones that can be checked & handled in our code. Ex: I/O Exception, SQL Exception etc. In most cases, the compiler itself forces us to catch & handle these exceptions * Un-checked Exceptions - The ones that we cannot & should not handle in our code. Ex. Null Pointer Exception The java.lang.Throwable is the super class of all errors and exceptions in Java. Only objects of this class can be thrown & caught and handled by try-catch blocks. Ex: try { ..... ..... } catch (Exception e){ ... } finally { ... }


What is defferred exceptional handling?

Deferred exception handling refers to a programming design pattern where individual class level methods do not handle exceptions using try catch blocks. They just cascade the exceptions to the calling methods using the "throw" keyword and all exceptions are handled centrally in one place. This is called deferred exception handling where the exceptions are deferred in the place where they occur and propagated to a parent class which handles it.


Does a method can throw an exception in java?

Yes it can. It is preferable to have code that will handle these exceptions in every class rather than throwing random exceptions that might confuse the user of the system


What is class hierarchies in java?

The top level class in Java is class Object. Every other class inherits from Object and therefore Object is the top most in the class hierarchy. If you extend a class from Object such as class Animal and further extend Animal with class Dog then the hierarchy is as follows: Object | Animal | Dog Code for this hierachy is as follows: class Animal { } class Dog extends Animal { } We don't need to write class Animal extends Object because every class extends from Object so it does not need to be stated.


Why is the top level class is considered the largest class in a class hierarchy?

I wouldn't consider it any larger than other classes - it is just the top of the hierarchy.

Related questions

Describe the JAVA throwable class hierarchy and types of exceptions?

In Java there are two main types of Exceptions. * Checked Exceptions - The ones that can be checked & handled in our code. Ex: I/O Exception, SQL Exception etc. In most cases, the compiler itself forces us to catch & handle these exceptions * Un-checked Exceptions - The ones that we cannot & should not handle in our code. Ex. Null Pointer Exception The java.lang.Throwable is the super class of all errors and exceptions in Java. Only objects of this class can be thrown & caught and handled by try-catch blocks. Ex: try { ..... ..... } catch (Exception e){ ... } finally { ... }


What is the super class that handles all runtime exceptions?

import java.lang.Exception, the Exception class.


The top most class in java?

All classes in java must inherit from the Object class


When you extend a class and override a method can this new method throw exceptions other than those that were declared by the original method?

No it cannot throw, except for the subclasses of the exceptions thrown by the parent class's method


What was the top social class in most ancient societies?

The Upper class which included Kings, Queens, Priests and Government Officials


Is a fly a vertebrate or invertebrate?

A fly is an invertebrate. All of them. No exceptions.


What members of class tend to bypass public schools entirely?

upper class. of course though, there are exceptions to every rule and for every rich kid in public school, there's someone on financial aid or a scholarship at most private schools.


What has the author Top of the Class written?

Top of the Class. has written: 'Fun With Computers'


What are the top class countries?

The most powerful country is USA after that it is China. I hope this answers your question. :)


Can a hp desk top Operating System Disc be used for a lap top?

|Generally, yes. There may be exceptions


What is defferred exceptional handling?

Deferred exception handling refers to a programming design pattern where individual class level methods do not handle exceptions using try catch blocks. They just cascade the exceptions to the calling methods using the "throw" keyword and all exceptions are handled centrally in one place. This is called deferred exception handling where the exceptions are deferred in the place where they occur and propagated to a parent class which handles it.


Does a method can throw an exception in java?

Yes it can. It is preferable to have code that will handle these exceptions in every class rather than throwing random exceptions that might confuse the user of the system