Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Ask a Meaningful Question and HowToAskQuestionsOnJavaRanch
Getting someone to think and try something out is much more useful than just telling them the answer.
Thanks,<br />-Rancy
i donot find any wrong in the above assertion used except none included any try/catch for assertion error.
all events occur in real time
Originally posted by pandoo pandoo:
line 1 public class Asserttest3
2 {
3 public static Boolean message()
4 {
5 System.out.println("Error");
6 return new Boolean("true");
7}
8 public static void main(String[] args)
9{
10 boolean b =false;
11 assert b:message();
12 int x = -5;
13 assert(x+1)>0;
14 assert x>0x= x * -1);
15 assert !b;
16 while(true)
17 {
18 System.out.println(x);
19 assert x-- > 0;
20 }
21 }
22 }
Find out the line which used the assertion inappropriately.
Select multiple options:
1) line 11
2)line 13
3)line 15
4)line 19
5)line 14
i donot find any wrong in the above assertion used except none included any try/catch for assertion error.what could be the output.?