exceptions in java

Solutions on MaxInterview for exceptions in java by the best coders in the world

showing results for - "exceptions in java"
Avril
01 Apr 2017
1In java exception is an object. Exceptions are created when an abnormal 
2situations are arised in our program. Exceptions can be created by JVM or 
3by our application code. All Exception classes are defined in java.lang. 
4In otherwords we can say Exception as run time error. I use try & catch blocks 
5to handle any exceptions in my code. 
6  I am familiar with major checked and unchecked exceptions and 
7  handle it accordingly to make my code execution smooth
Maximilian
29 Jan 2019
11.Unchecked: occurs during run time
22.Checked Exceptions:occurs during the compile time. 
3needs to be handled IMMEDIATELY
4Exception handling: try & catch: blocks, used for handling the exception 
5 
6throws keyword is used within the method signature 
7disadvantage is: throws keyword whoever calls the method 
8will have to handle the exception again but with 
9try/catch you handle once. Try/catch is better way to handle it 
10in utility class. Next time you call method you don’t get any exceptions
11 
12most common Exception like NullPointerExceptio, 
13ArrayIndexOutOfBound, ClassNotFoundException, IOException.
14are unchecked and they are descended from java.lang.RuntimeException
15In Selenium: nosuchelement, nostaleexception, nosuchaframe 
16In SQL: SQL exception 
Klara
03 Jul 2018
1Unchecked:
2-IndexOutOfBounds exception(while working with arrays/strings)
3-NullPointerException(if I forget to instantiate the objects)
4-ArithmaticException
5
6Checked:
7-IOException
8-SQLException
9-FileNotFountException