Exercise 6


#1

still can't go through the exercise 6

code:
if (9>2||7>10) {

		System.out.println(true);}

the error is "Did you use a Boolean expression that evaluates to true?"

how can i pass it?


#2

@designsolver56098
could you provide the FULL code you are using.....
and the link to the exercise.....


#3

https://www.codecademy.com/en/courses/learn-java/lessons/conditionals-control-flow/exercises/if-statement?action=lesson_resume

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

	 if (9>2||7>10) {

		System.out.println(true);
                   
                 		}
	
}

}


#4

@designsolver56098
You could try to use some space-characters in you expression like (7 > 3)
Try it with

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

		if (1 > 0) {

			System.out.println("Access granted.");

		}
		
	}
}

#5

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