Win a copy of Pipeline as Code this week in the Cloud/Virtualization 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

Choosing between "exit" and "exception thrown" options

 
Greenhorn
Posts: 2
Netbeans IDE MySQL Database Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all. My first post so please direct me to where questions like this can be answered if the forum isn't the right place.

This question is based on question 9 of chapter 9 in the SCJP 6 study guide by Kathy and Bert. The code is immaterial to the principal I'm exploring here so I won't include it. The answer choices are:
A. It prints X and exits
B. It prints X and never exits
C. It prints XY and exits almost immediately
D. another option
E. another option
F. The code does not compile
G. An exception is thrown at runtime

The code would have been printed X and then an exception would have been thrown. In my answer I chose A and G. A because the X would have been printed and the program would have exited after the X was printed. And G because the exit would have been caused by the throw of an exception.

The answer given in the book for this question is just G, from which I wonder whether the word "exit" is being used for normal termination and not an abrupt termination.

My question is this: In the exam when I see the word "exits" in the exam, should I infer that this means a normal exit and not a throw?

 
Ranch Hand
Posts: 394
Eclipse IDE Oracle Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Paul Norris wrote: In the exam when I see the word "exits" in the exam, should I infer that this means a normal exit and not a throw?



Hi Paul, welcome to javaranch

To the best of my knowledge "exits" as it stands means "normal exit", logically if it were "otherwise" then an adjective would be added to "exits" in this case "exits abruptly".

Regards

Ikpefua.
 
Paul Norris
Greenhorn
Posts: 2
Netbeans IDE MySQL Database Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for that, Ikpefua. Cheers!
 
Willie Smits increased rainfall 25% in three years by planting trees. Tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic