ERROR HANDLING AND EXCEPTION

No comments


Types of Error : There are two types of error.

1. Compile time error.
2. Run time error.

1. Compile time error :
All syntax error will be detected and displayed by the java compile and therefore this error is known as compile tile error. Whenever the compiler displayed and error it will not create the class file. It is therefore necessary we fixed all the error before we can successful. Compile and run the program most of the compile time error and due typing mistakes. The most common problems are : –

1..Missing semicolons.

2..Missing on mismatch of brackets in classes and method.

3..Misspelling of identifier on keyword.

4..Missing double quotes in strings.

5..Use of undeclared variable.

6..In compatible time in assignment or initialization.

7..Bad references of object.

8..Use of== in place of== proposer.

2. Run time error :
Sometimes a program may compile successfully creating the do not class file but may not run properly. Such programs may produce wrong result due to wrong logic or may terminate due to error such as stack overload most common run time error are : –

1..Dealing and integer by zero.

2..Accessing an element that is out of the bounds of an array.

3..Trying to store available into array in compatible class object type.

4..Trying to cast instants of a class to one of it subclasses.

5..Passing a parameter that is not in a valid range or value for a method.

6..Trying to illegally the state of a thread.

7..Attempting use a negative size for an array.

8..Converting invalid string to a number.

9..Accessing a character that is out of bouncing of a string.

No comments :

Post a Comment

Subscribe

Milan Panda
Admin
About Me | Contact
Copyright 2023-2024 © Programming1011 . 🎀 Developed and Design By- Milan Panda. Happy Holi All Of You 🎀