How do you solve problem 11/12?


#1

URL to exercise: https://www.codecademy.com/en/courses/learn-java/lessons/introduction-to-java/exercises/equality-operators

how do you solve problem 11/12

public class EqualityOperators {
	public static void main(String[] args) {

		System.out.println();

	}
}

Question 11- Conditionals and Conditions Flow
#3

Instructions:
Use any equality operator to directly compare two Boolean values. Do not declare any variables.

The equality operators are:

==: equal to
!=: not equal to

so you can compare like

5+5==12 // using == operator

or

8+5!=25 //using != operator

your code should like

public class EqualityOperators {
	public static void main(String[] args) {

		System.out.println(); // compare inside the parenthesis

	}
}

#4

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.