What is exception and error? and what is the difference
between them?

Answer Posted / janet

The exception class defines mild error conditions that your
program encounters.
Ex: Arithmetic Exception,FileNotFound Exception

Exception can occur when
--> Try to open the file,which does not exist
--> the network connection is disrupted.
--> operands being manipulated are out of prescribed
ranges.
--> the class file you are interested in loading is
missing.
The error class defines serious error conditions that
you should not attempt to recover from .in most cases it is
advisable to let the program terminate when such an error
is encountered.
Ex. Running out of memory error,stack overflow error.

Is This Answer Correct ?    2 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is java virtual machine? Explain

571


What is increment in java?

527


What is the advantage of functional interface in java 8?

523


What is abstract class? Explain

597


Define jit compiler?

662






Define reflection.

575


How many types of operators are there?

525


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.

1585


What is a bubble sort in java?

547


What is constructor in java ?

636


Can we execute a program without main?

541


How do you declare an empty string?

622


What is jit compiler in java?

590


You can create a string object as string str = “abc”; why cant a button object be created as button bt = “abc”;? Explain

534


What is the purpose of static methods and variables?

533