Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Assertions  RSS feed

 
Divya Eknath
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
which of the following line causes a compiler error?

public static void main(String[] args)
{
method();
assert false;
assert false;
}
public static void method()
{
while(true)
{
assert false;
}
assert false;
}
 
Gowher Naik
Ranch Hand
Posts: 643
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

line 1 in Above code is unreachable so it is compile time error.
 
Barry Gaunt
Ranch Hand
Posts: 7729
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please use tags and format your code. Thanks.

Did you compile the code yourself?
[ July 29, 2006: Message edited by: Barry Gaunt ]
 
wise owen
Ranch Hand
Posts: 2023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check this thread.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!