Win a copy of Murach's MySQL this week in the JDBC and Relational Databases forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Jvm thrown exceptions & programmatically thrown exceptions

Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anybody please explain what is JVM thrown exception and Programatically thrown exception. this is a question from java.Inquisition mock exam.

Fill in the table to indicate which Exception and Error classes are typically thrown programatically and which by the JVM.

This is the answer.

ArrayIndexOutOfBoundsException by JVM

ClassCastException by JVM

IllegalArgumentException Programatically

IllegalStateException Programatically

NullPointerException by JVM

NumberFormatException Programatically

AssertionError Programatically

ExceptionInInitializerError by JVM

StackOverflowError by JVM

NoClassDefFoundError by JVM

both NumberFormatException and StackOverfowError are unchecked exceptions
then why one is thrown programatically and another by JVM.

It is confusing.Can any body explain, or refer book .

Ranch Hand
Posts: 278
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
K &B book has explained ,on what basis they are categorrized.

IllegalState,...IllegalArgument,Numberformat..were decided by API developers that if argument entered is worng,exception should be thrown
so not thrown by JVM.
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic