Question
How does exception handling work in Java?

Answers

1.It separates the working/functional code from the error-handling code by way of try-catch clauses.
2.It allows a clean path for error propagation. If the called method encounters a situation it can't manage, it can throw an exception and let the calling method deal with it.
3.By enlisting the compiler to ensure that "exceptional" situations are anticipated and accounted for, it enforces powerful coding.
4.Exceptions are of two types:
Compiler-enforced exceptions, or checked exceptions
Runtime exceptions, or unchecked exceptions
Compiler-enforced (checked) exceptions are instances of the Exception class or one of its
subclasses -- excluding the RuntimeException branch. The compiler expects all checked exceptions to be appropriately handled. Checked exceptions must be declared in the throws clause of the method throwing them -- assuming, of course, they're not being caught within tha t same method. The calling method must take care of these exceptions by either catching or declaring them in its throws clause. Thus, making an exception checked forces the us to pay heed to the possibility of it being thrown. An example of a checked exception is java.io.IOException. As the name suggests, it throws whenever an input/output operation is abnormally terminated.   Your Comment




More Software,Java Questions..
What is the inputsplit in map reduce software?

Can variables be used in Java without initialization?

What is the difference between java bean and enterprise java bean?

What is software configuration management?

How does the java database connectivity (jdbc) work?

What are the advantages of threads in java?

What Is Java Api For Xml-based Rpc (jax-rpc)?

How can you implement fine-grained auditing?

What is IBM’s simple explanation for Big Data’s four critical features?

What is static synchronized method in JDBC API? Give an example?

What does the NULLIF function do?

What happens if a start method is not invoked and the run method is directly invoked?

Should we override finalize method

what is the difference between mysql_fetch_array and mysql_fetch_object?

How will XML affect my document links?

What is object cloning in Java?

Why to use Style Sheets?

What are Filters in MVC?

Can you explain Application layer in OSI model?

How to define new testplan attributes?



Search
Can you Answer!!
  • Q Data staging is actually a group of procedures used to prepare source system data for loading a data warehouse.?
  • Q Who is the 1st Indian to be appointed as a Technical Delegate by FIBA?
  • Q To select records from particular row(the remaining rows)
  • Q What was ISO 17799 originally called?
  • Q What are data regions?
  • Q Name the family and order of Queen parrotfish ?
  • Q What safety device will activate to stop the compressor in the refrigeration system
  • Q In the world of Food and Agriculture what does the acronym GM stand for?
  • Q Is there any difference between seo & smo? describe if any?
  • Q Name the mouth parts of cockroach.
  • Q Which command is used to check the IP address of your system?