Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in Java by (7k points)

I know there is no way to find out which exceptions a method throws without looking up the API docs one-by-one. So, I would like to ask you which are the most common Exceptions and runtime exceptions you have come across when dealing with:

  • Casting

  • Arrays

  • Vector, ArrayList, HashMap, etc.

  • IO

  • Object Serialization

  • Threads

1 Answer

0 votes
by (13.1k points)

Assume that the below things belongs to java.lang unless I specify otherwise:

  • Casting: ClassCastException

  • Arrays: ArrayIndexOutOfBoundsException, NullPointerException

  • Collections: NullPointerException, ClassCastException

  • IO:,,

  • Seralization:

  • Threads: InterruptedException, SecurityException, IllegalThreadStateException

Want to learn Java? Check out the Java certification from Intellipaat. 

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

Browse Categories