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.
A friendly place for programming greenhorns!
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)
Author
Assertions
Divya Eknath
Greenhorn
Joined: Jul 27, 2006
Posts: 9
posted
Jul 28, 2006 21:13:00
0
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
posted
Jul 28, 2006 22:01:00
0
public static void method(){ while(true) { assert false; } assert false;//line 1 }
line 1 in Above code is unreachable so it is compile time error.
Barry Gaunt
Ranch Hand
Joined: Aug 03, 2002
Posts: 7729
posted
Jul 29, 2006 00:10:00
0
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
posted
Jul 29, 2006 04:39:00
0
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
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter