Win a copy of TDD for a Shopping Website LiveProject this week in the Testing 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:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

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.
 
Sasparilla and fresh horses for all my men! You will see to it, won't you tiny ad?
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic