Win a copy of Rust Web Development this week in the Other Languages 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 ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Jvm thrown exceptions & programmatically thrown exceptions

 
Greenhorn
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 .

Thanks
lakshmi
 
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.
reply
    Bookmark Topic Watch Topic
  • New Topic