Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Struggling to remember subclasses of Exception.

 
Prathima gaitonde
Ranch Hand
Posts: 130
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Can any one tell me the trick to remember the subclasses of class Exception?
i.e

  • which belongs to RunTimeException and which one is not.


  • which one is subclass of which, in order to figure out compile time error.
    such as :
    catch(ParentCalss p)
    {}
    catch(ChildClass c)
    {}


  • There are too many subclasses to remember. For example there is no such thing called ServerException class, which is a subclass of Exception. But SQLException is there.


  • I am getting giddy now.

     
    Jeanne Boyarsky
    author & internet detective
    Marshal
    Posts: 35279
    384
    Eclipse IDE Java VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Neither ServerException or SQLException is on the OCA exam. What book are you using to study? All the study guides list a subset of exceptions that you need to know.
     
    Roel De Nijs
    Sheriff
    Posts: 10662
    144
    AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I would strongly suggest using one of the study guides out there! They cover everything you need to know to pass the exam. The Mala Gupta one and K&B7 are probably the better ones on the market and get very good (to excellent) reviews.

    For the OCAJP7 exam you should just know a limited set of exceptions and errors, like NullPointerException, ClassCastException, StackOverflowError and some others.
     
    Prathima gaitonde
    Ranch Hand
    Posts: 130
    3
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Whatever there in the chapter 8 about exception handling in Mala Gupta's book is that enough?!!!
     
    Roel De Nijs
    Sheriff
    Posts: 10662
    144
    AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Prathima gaitonde wrote:Whatever there in the chapter 8 about exception handling in Mala Gupta's book is that enough?!!!

    Chapter 8 is the mock exam
     
    Prathima gaitonde
    Ranch Hand
    Posts: 130
    3
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Sorry I mean to say Chapter 7 Exception handling. I have read that book, as my preparation for the exam. Still not sure is that enough, as I saw some questions like

    Which of the following are subclasses of java.lang.Exception? Choose all that apply.
    1> IllegalAccessException
    2> FormatException
    3> VartualMachineError
    4> NamingExcepiton
    5> ServerException
    6> RuntimeException


    This was the question from book called Java Practice Questions: Oracle Certified Associate, Java SE 7 Programmer (OCAJ) by Esteban Herrera
     
    Sergej Smoljanov
    Ranch Hand
    Posts: 467
    10
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    never see this book before
    all variat that end with Error - not.
    FormatException - there is no that exception. there is NumberFormatException and IllegalFormatException

    java.lang.IllegalAccessException, javax.naming.NamingException, java.rmi.ServerException - checked exeption, but in study guide i have never see this, and rmi and javax pacage for my mind there is no in actual exam, or i wrong?
    may be who pass answer is or not in exam?

    in this topic we discuss about exception on exam, may be it help
     
    Jeanne Boyarsky
    author & internet detective
    Marshal
    Posts: 35279
    384
    Eclipse IDE Java VI Editor
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Prathima,
    IllegalAccessException and RuntimeException are the only ones on the exam from that list. Numbers 3-5 on your list weren't even on older versions of the exam.

    rmi and javax are definitely not on the exam.
     
    Sergej Smoljanov
    Ranch Hand
    Posts: 467
    10
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    IllegalAccessException throws by programmer or JVM?
    and can you give code example of it.
     
    Jeanne Boyarsky
    author & internet detective
    Marshal
    Posts: 35279
    384
    Eclipse IDE Java VI Editor
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    I'm sorry. I misread the exception. IllegalAccessException is not on the exam either. IllegalArgumentException is on the exam (which is thrown by the programmer.)
     
    Roel De Nijs
    Sheriff
    Posts: 10662
    144
    AngularJS Chrome Eclipse IDE Hibernate Java jQuery MySQL Database Spring Tomcat Server
    • Likes 1
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    Prathima gaitonde wrote:Still not sure is that enough

    In K&B7 this is the list of common exceptions and errors: ArrayIndexOutOfBoundsException, ClassCastException, IllegalArgumentException, IllegalStateException, NullPointerException, NumberFormatException, AssertionError, ExceptionInInitializerError, StackOverflowError and NoClassDefFoundError.

    In Mala Gupta's study guide these common exceptions and errors are covered: ArrayIndexOutOfBoundsException, IndexOutOfBoundsException, ClassCastException, IllegalArgumentException, IllegalStateException, NullPointerException, NumberFormatException, ExceptionInInitializerError, StackOverflowError, NoClassDefFoundError and OutOfMemoryError.

    Both lists are very similar. So no worries! You know what's required to answer questions on these topics correctly

     
    Prathima gaitonde
    Ranch Hand
    Posts: 130
    3
    • Mark post as helpful
    • send pies
    • Quote
    • Report post to moderator
    My big thanks to @Roel and every one who has helped regarding my query, in this forum.
     
    • Post Reply
    • Bookmark Topic Watch Topic
    • New Topic