+ 1
Excuse me but I don't find m'y error can you help me
import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner y = new Scanner(System.in); int z = y.nextInt(); for (int x = 0; x >= y; x++){ System.out.println(x); } } }
4 Answers
+ 2
It mentions the error.
Essentially you are trying to compare an instance of Scanner (y) with an int variable (x)
'x >= y' is your error. Both values need to be of the same type, in this case 'int'.
+ 2
ok thanks
+ 2
Also, remember that 'x' starts at 0, so depending on what you're doing, you may need to change to test for '<='
+ 2
ok