• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How do you answer such questions?

 
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,

I saw this question on one of mock exam's and was wondering how one should approach such questions. Also does the real exam have such one's.

Below is the question, it does not mention anything ex: where the method is invoked with any parameter's / with the one's which will raise an exception...



Example: divide( 5, 4 ) - Finally
divide( 5, 0 ) - Exception Finally.

How do you decide?

Thanks.

(code brackets fixed)
[ August 03, 2004: Message edited by: Barry Gaunt ]
 
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kitty,

Your answer is correct. "Finally" is always printed. "Exception" is printed when an ArithmeticException is thrown. What answer was provided by the mock exam?
 
Ranch Hand
Posts: 66
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
maybe the question was "Check all that applies" ??
Since finally block always runs in this example, the answer is 1 and 3 ?
 
Kitty Dayal
Ranch Hand
Posts: 89
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Dan & Ryan,

Thanks for your replies. My doubt was actually different.

First,
Will there be question like the ones I asked in the real exam. As you can see, in this mock question, they didn't specify any question(Just code and options) and so it will be very hard to decide what they are actually looking. Have any of you come across such type of questions without actual question in your exams.

Secondly the answer that he gives in Exception Finally. No Explanation why so. (Also they had a radio button for that question, by which you could only select one option of the four).

Thanks,
Kits
 
Dan Chisholm
Ranch Hand
Posts: 1865
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Kitty,

The questions on the real exam are not like what you have described. The questions on the real exam contain actual questions. You won't find yourself wondering what the question actually is.

You mentioned that the question only provided radio buttons for a question that clearly has two correct answer options. The real exam is not perfect, but you probably won't see that kind of error on the real exam.

The questions on the real exam do specify the number of answer options that must be selected. The questions on my web site don't provide that information, but the questions in my book do.

You said that the mock exam provided no explanation for the answer. I hope that you didn't pay for that mock exam.

What mock exam is it?
 
Ranch Hand
Posts: 267
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all
About the mock i have taken it as well and it never said what u were suppose to do! I even chose the No output option cause it never allowed multiple answers! It's one of the listed exams on the mock page! I think it's 4test.com or something like that!
 
I'm thinking about a new battle cry. Maybe "Not in the face! Not in the face!" Any thoughts tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic