what is the difference between checked and unchecked
Exceptions?

Answers were Sorted based on User's Feedback



what is the difference between checked and unchecked Exceptions?..

Answer / aravinda reddy

1) Checked Exceptions extends Exception and
UncheckedExceptions extends RuntimeException.
2) Checked Exception must be caught in the code using try -
catch-finally or declared thrown where as unchecked
exceptions no need to catch or thrown declared
3) None is functionally better than the other
4) Checked Exception is most common excpetions while
coding, so may be authors have made it as mandatory to
handle the excpetion while coding
5) We can create custom checked and unchecked exceptions by
extending Exception and RuntimeException.

Is This Answer Correct ?    11 Yes 0 No

what is the difference between checked and unchecked Exceptions?..

Answer / rohit

checked exceptions are error is suppose source file is
open... unchecked exception are error i.e array index out of
bound..thats all checked exception occur at compile time and
unchecked exception occurs at run time.

Is This Answer Correct ?    12 Yes 2 No

what is the difference between checked and unchecked Exceptions?..

Answer / santosh mundhe

Unchecked Exception(Runtime Exception):
there is no need to declare runtime exceptions, in simple
words we can say that at run time JVM will handle the
exception.

Checked Exception(Compiletime Exception):
at compile time JVM will check for exception for that it's
compulsory to handle the exception.Checked exceptions force
you to catch the exception and to do something about it.

Is This Answer Correct ?    7 Yes 1 No

what is the difference between checked and unchecked Exceptions?..

Answer / surya bondada

The exception which are checked by the complier are called
as checked exception.
The exception which are not checked by the complier are
called as unchecked exceptions.

Example for Checked Exceptions are:Exception,intrupted
Exception,serveltException,Io Exception and all child
classes are the examples for checked Exceptions.

Example for Uncheked Exceptions are:Runtime Exception it is
child of Exception,and child classes of Runtime Exceptions
like ArrayIndexOutofOrder,illegalmonitersafe
exception,illegal argement exception,Arthimatic
exception,and class cast exception,And All Error and child
classes are example for unchecked .

Is This Answer Correct ?    2 Yes 1 No

Post New Answer

More Java J2EE AllOther Interview Questions

What is java collection? : java collections

0 Answers  


How to call the m1() method of Base class in below snippet ? class Base { public void m1() { System.out.println("Base m1 "); } public void m2() { System.out.println("Base m1 "); } } ====================== class Derived extends Base { public void m1() { System.out.println("Derived m1"); } public void m3() { System.out.println("Derived m3"); } public static void main(String[] args) { Base ob=new Derived(); ob.m1(); //System.out.println("Hello World!"+ob.m1()); } }

6 Answers   Cap Gemini, TCS,


What is the use of hashcode in java ?

0 Answers  


What is the enumerator of the java collection framework? : java collections

0 Answers  


what is the IDE that you have used to write your java programs?

2 Answers   Inforica, Interface Software,






What causes Out of Memory exception?

5 Answers   CTS,


2. Write a interface "Car" with the following methods void setName(String) String getName() void setColor(String) String getColor() void setModel(long) long getModel()

1 Answers  


Is it Mandatory to map each pojo class variable with table column in Hibernate? Is there any alternative to skip some of those? Thanks in advance...

2 Answers   Span Systems,


What is the use of the list interface in the java collection? : java collections

0 Answers  


Explain the OOPS concept in Realtime Scenarion ? Take example as CAR. Please explain indetail ?

0 Answers   Cap Gemini,


what is mean by hasing and maping in java platform and advantage?

0 Answers   CTS,


In hyderabad, which s/w training center is best for java, other than corejava what r the new tools to learn in java,which tool is best & have current requirement,pls give me information about java to learn ?

0 Answers  


Categories