31. 31. Where is the error in this code sequence? 32. 32. Where is the error in
ID: 3754591 • Letter: 3
Question
31. 31. Where is the error in this code sequence? 32. 32. Where is the error in this expression? b2 bl AND ala2 33. 33. Where is the logical error in this code sequence? if al4 System.out.printin( "al equals 4" 34. 34. Where is the error in this code sequence? boolean b1 = true ; if b1 System.out.printin( "bl is true" 35. 35. Where is the error in this code sequence? if [ b2 - true System.out.printin( "b2 is true": 36. 36. Where is the error in this code sequence? if (bl true ) System.out.println( "bl is true" System.out.printin"b is false"; System . out.println( "al isExplanation / Answer
31. && operator is not defined for int variables. it is used with boolean variables. the error is that && can not be used with int a1 and int a2;
32. AND is not an operator in java. so error is AND operator.
33. if(a1==4); the logical error is using semi colon after if(); it means that the statement after if() is not excuted based on if condition. the statement after if() is executed each time. it treats semicollon as one statement;
34. if b1==true is not a valid java statement. but if(b1==true) is. so braces are must.
35. if{b2==true} is not a valid statement. but if(b2==true) is. if condition uses braces not curly braces.
36. else if() statement can not be after else statement but it can be before else statemet;
37. it has not errors;
38. it does not have any error.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.