Related questions with answers
Question
Find the errors in the following code:
// Warning! This code contains ERRORS!
if (x = 1)
System.out.println(x);
else if( x == 2);
{
x++;
System.out.println(x);
}
Solutions
VerifiedSolution A
Solution B
Answered 1 year ago
Step 1
1 of 3The code given contains error(s). We have to find the errors in the given code.
-
if (x=1)
-
System.out.println(x);
-
else if (x ==2)
-
{
-
x++;
-
System.out.println(x);
-
}
Answered 1 year ago
Step 1
1 of 3The only error of the given code lies in the if statement condition expression.
Create an account to view solutions
By signing up, you accept Quizlet's Terms of Service and Privacy Policy
Create an account to view solutions
By signing up, you accept Quizlet's Terms of Service and Privacy Policy
More related questions
- discrete math
1/4
- discrete math
1/7