Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Exceptions

 
Rob Petterson
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone tell me if we need to memorize the various Exception and Runtime classes off by heart in order to able to answer questions where overriding methods using various exceptions come into play?
I.E. what I am saying is in the real exam, will it tell you that for example, IOException is a checked exception and NumberFormatException is a runtime exception if you were determining if say a piece of code would compile if using overriding methods with these vaious exceptions tagged onto the end of each of the methods?
 
Corey McGlone
Ranch Hand
Posts: 3271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't need to memorize the various exceptions for the exam. However, if you've studied exceptions at all, a few major ones should jump out at you as being either checked or unchecked exceptions.
For example, IOException is checked (as you pointed out) and things like ArrayIndexOutOfBoundsException is unchecked. Knowing a few of the more common ones by heart wouldn't hurt and, frankly, I think you'll end up knowing them simply from studying exceptions.
I hope that helps,
Corey
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although you don't have to memorize all of them, you really should be familiar with all the exception classes in the java.lang package.
 
Manish Hatwalne
Ranch Hand
Posts: 2591
Android Firefox Browser Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In general, you should know which are runtime exceptions. They usually test you for this while method overriding.
HTH,
- Manish
 
Rob Petterson
Ranch Hand
Posts: 149
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks to you all.For the time being I'll think I'll learn a few of the runtime exceptions just to play it safe - just the more obvious ones though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic