Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

Should I know the runtime exceptions for the exam?

 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One of the topics of the exam is to be able to see the difference between code involving checked and unchecked or runtime exceptions. But should I actually know what are the RuntimeExceptions, when they are thrown in a program? From the list below I only know NullPointerException. And other Exceptions like IOExceptions I thought would be runtime errors, but appearantly are not.

http://java.sun.com/j2se/1.4.2/docs/api/java/lang/RuntimeException.html
 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah you need to know what are programmatically and JVM thrown exceptions.
You will have to recognized what exception the given code may throw. List of
Exceptions covered in the exam objective can be found Page 370 of K&B.



Thanks,
 
Marc Wentink
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks. Another question about this topic. It seems logical that JVM thrown exceptions are always unchecked RTE, but I cannot seem to put my finger on a text that actually confirms that. It is true though, JVM throwns are pro def unchecked?
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


It seems logical that JVM thrown exceptions are always unchecked RTE, but I cannot seem to put my finger on a text that actually confirms that. It is true though, JVM throwns are pro def unchecked?



RuntimeException is a class that extends Exception. Any exception that
inherits from the RuntimeException is unchecked exception. If your confusion
is there is something called compile time exception, that is wrong. Stick
to the fact that RuntimeException is a class and this as well any subclasses
of this throw unchecked exception.

Unchecked exception just means you don't need to handle or declare that exception where as checked exceptions must be caught or declared otherwise
compiler error.


Thanks,
[ May 30, 2007: Message edited by: Chandra Bhatt ]
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Marc Wentink:
Thanks. Another question about this topic. It seems logical that JVM thrown exceptions are always unchecked RTE, but I cannot seem to put my finger on a text that actually confirms that. It is true though, JVM throwns are pro def unchecked?



Yeah, as you say, they pretty much have to be unchecked, otherwise programming in Java would be unbearably annoying! See:

http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.6
[ May 30, 2007: Message edited by: Matt Russell ]
 
Marc Wentink
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you very much for the information.
 
Ranch Hand
Posts: 329
Oracle Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
These are the exceptions mentioned in the exam's objectives:


Recognize situations that will result in any of the following being thrown: ArrayIndexOutOfBoundsException,ClassCastException, IllegalArgumentException, IllegalStateException, NullPointerException, NumberFormatException, AssertionError, ExceptionInInitializerError, StackOverflowError or NoClassDefFoundError. Understand which of these are thrown by the virtual machine and recognize situations in which others should be thrown programatically.

 
If you were a tree, what sort of tree would you be? This tiny ad is a poop beast.
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic