Predict the output or error(s) for the following:
1)
int i,j;
for(i=0;i<=10;i++)
{
j+=5;
assert(i<5);
}
Answer:
Runtime error: Abnormal program termination.
assert failed (i<5), <file name>,<line number>
Explanation:
j+=5;
assert(i<5);
Runtime error: Abnormal program termination.
assert failed (i<5), <file name>,<line number>
assert(a > 0); // throws an AssertionError if a <= 0
assert Expression1 ;
assert Expression1 : Expression2 ;