what are Checked & Unchecked exceptions ?

Answer Posted / aparna

Checked exceptions should be taken care by the user using
try and catch blocks otherwise runtime error occurs
for eg:
class.forName() method throws ClassNotFoundException which
should be caught between try and catch blocks

Unchecked exceptions are taken care by the jvm itself, user
need not worry about these type of exceptions
for eg:
Integer.parseInt() method throws NullPointerException which
need not be placed between try and catch blocks

Is This Answer Correct ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a java program that prints all the values given at command-line.

559


Explain which of the following methods releases the lock when yield(), join(),sleep(),wait(),notify(), notifyall() methods are executed?

617


Why destructor is not used in java?

525


Explain the difference between abstraction and encapsulation.

539


Is it compulsory for a try block to be followed by a catch block in java for exception handling?

596






Why chararray() is preferred over string to store the password?

530


How do we access static members in java?

630


Can we inherit inner class?

524


What is appletviewer?

574


What is the difference between static and global variables and also define what are volatile variables?

558


What do you mean by formatting?

547


What is the final class?

552


what is nested class in java?

603


What is the difference between a static and a non-static inner class in java programming?

533


How will you serialize a singleton class without violating singleton pattern?

1527