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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

assertion question

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
]what will be the right answer ?

and why ?

REMOVED
[ August 08, 2007: Message edited by: Burkhard Hassel ]
 
Ranch Hand
Posts: 142
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Given a method that must ensure that its parameter is not null:

public void someMethod(Object value)
{
....

}

What inserted at the dots is the appriopiate way to handle a null value?

REMOVED


Well I think you assert something that must be true, so if you use assert then you must assert value not to be equal to null. Hence answer A goes down the toilet. B could be correct, in the ',' comma was a ':' colon, since the assert statement was either assert condition or assert condition : stringvalue. D does not seen right to me either since this exception is more for illegal arguments when you are doing convertions. So I think C is the lest worse option.
[ August 08, 2007: Message edited by: Burkhard Hassel ]
 
Straws are for suckers. Now suck on this tiny ad!
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
    Bookmark Topic Watch Topic
  • New Topic