This week's book giveaways are in the AI and JavaScript forums.
We're giving away four copies each of GANs in Action and WebAssembly in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of GANs in ActionE this week in the AI forum
or WebAssembly in Action in the JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

Things to know about Exceptions for Exam

 
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All

For exam do we need to know about all the exceptions that comes under Exception class and RuntimeException class or is it enough if we know about the exceptions given in K & B book.

Thanks
Srividhya
 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Objective 2.6 declares the following:

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.



I'd guess that it's worth recognising the differences between java.lang.Throwable, java.lang.Error, java.lang.Exception, java.lang.RuntimeException (i.e. unchecked exceptions) plus the exceptions mentioned in the objective above.
 
Srividhya Kiran
Ranch Hand
Posts: 166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

Illegal State Exception is a subclass of Runtime Exception.
i.e. There is no need to handle it.

I want to ask you that is there any rule Like..Runtime Exception is thrown by JVM and Checked Exception is thrown Programmatically ??

The IllegalStateException is Runtime Exception but as mentioned in page no 370 of K&B it is thrown Programmatically.

Please Help this Really Confuse me.

Thanks
 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Checked and Unckecked exceptions have nothing to do with who throws them. In some cases, it might be the developer, it might be the JVM. It's more important to know that the JVM will definately throw Errors, for everything else you should be guided by your common sense , NullPointerException, AssertionError will most probably be thrown by the JVM (because it checks for nulls and for assertions), but IllegalStateException, NumberFormatException - most probably by the developer because you might write a class that parses some Numbers and might throw NumberFormatException if the numbers are not in the correct format.
[ May 06, 2008: Message edited by: Dumitru Postoronca ]
 
I knew I would regret that burrito. But this tiny ad has never caused regrets:
Sauce Labs - World's Largest Continuous Testing Cloud for Websites and Mobile Apps
https://coderanch.com/t/722574/Sauce-Labs-World-Largest-Continuous
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!