what is difference between Exception and Error?

Answer Posted / chandra sekhar dash

Exceptions are also one kind of errors which we can hadle at
both compile time and run time by using try and catch
blocks.
These are two types: Compile time and runtime.
Sql and IO Exceptions come under compile time
ArrayIndexOutofbounds and NullPointer these come under
runtime Exceptions

Errors are the problems which we cant hadle, like stack
overflow and memoryoutofbounds etc.,these generally comes at
compile time

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Differentiate between a constructor and a method? Can we mark constructors final?

678


What are predicates in java 8?

535


How you can force the garbage collection?

542


How many bits is a char?

539


What language is pass by reference?

574






How to reverse a string in java?

526


What are the advantages and disadvantages of reference counting in garbage collection?

581


How does java enable high performance?

696


For ease of programming you can consider the maze as a 2D array with colors represented by below integer and characters (in capital letters). • B - Black • W -White • G- Green • R- Red R B W B W W W W W W B W B B W W W W W W W B W B W W W B W W W W B B W W W B W W W B W W B B B B W B W B W W B W W W B W W W B B B W W B W W W B W W B W B W W W B W B W W W W B B W W W W B W W W W W G Shortest Route Problem: • Solution that finds the shortest Route between Red and Green  White will have 1 Weight.  Red and Green carry no weights.  Shortest path is the path with less weight when you add up the weights in the path.

1586


Where can I find jdk in my computer?

468


How can you set an applet’s height and width as a percentage?

517


Define jre i.e. Java runtime environment?

576


Explain jdk, jre and jvm?

571


Can I extend singleton class in java?

635


What's the default access specifier for variables and methods of a class?

518