This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Assertions Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Reply Bookmark "Assertions" Watch "Assertions" New topic
Author

Assertions

Divya Eknath
Greenhorn

Joined: Jul 27, 2006
Posts: 9
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

Joined: Feb 07, 2005
Posts: 643

line 1 in Above code is unreachable so it is compile time error.
Barry Gaunt
Ranch Hand

Joined: Aug 03, 2002
Posts: 7729
Please use tags and format your code. Thanks.

Did you compile the code yourself?
[ July 29, 2006: Message edited by: Barry Gaunt ]

Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
wise owen
Ranch Hand

Joined: Feb 02, 2006
Posts: 2023
Check this thread.
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Assertions
 
Similar Threads
Assertion Quesion 2:can you explain the reason
Doubt in Assert statement
Can u explain this assert question
Assertions
mock: assertion