Saturday 26 December 2015

What is Error in java with example

The state or condition of being wrong in conduct or judgment or error if irrecoverable that's is Error.

Error is wrong or invalid words use in your program or use unknown rules in your program's.



## Types of error:


  1. Syntax error
  2. Run time/Logical error



1. Syntax Error : It is also known as compile time errors. If we are complete our program's after then we are running program's then first of all program's in compiles in this session something show errors like example: Missing of semicolon, Misspell any keyword's, Mismatch any one and close parenthesis.


2. Run Time/Logical Error : Error occur while running of our program's. These error very dangerous very difficulty for programmer to track down.

Example's like as :  

            - Using a null object to reference an object members.
            - Divide an integer by zero and many more



Examples of RuntimeExceptions

  1. OutOfMemoryError
  2. VirtualMachineError
  3. AssertionError...etc

No comments:

Post a Comment