• 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

Assertion from witscale website

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A question from the witscale site , code:

The question and and choices:
Q 23. Which of the following statements will be part of the output if this
program is executed as:
$ java Test hello
(Note: Please click on 'Exhibit' button to see the code/information.)
1.hello
2.Test
3.alphabeta
4.done
5.None of the above

And the answer:
The correct answer is option 1.
The assertion will fail, therefore AssertionError occurs and arg[0] (hello) is printed on console.
I thought you'd have to enable assertion specifically to get answer number 1. Therefore the answer should be number 4 since assertion is not enabled when running this class. Any thought?
 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi
what u said seems corect.
Athe execution point
java Test hello,assertions are not enabled.So the answer will be done..
dhana


[ November 03, 2003: Message edited by: dhana rangu ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic