You are using these quotes “”
. That is why you’re getting the error. Use the standard double quotes for Strings.
if (x < y)
System.out.println("x is less than y"); // standard double quotes
x = x * 2;
if (x == y)
System.out.println("x now equal to y");
x = x * 2;
if (x > y)
System.out.println("x is greater than y");
// this won’t display anything.
if (x == y)
System.out.println("you won’t see this");
1
solved Java Simple Program [closed]