0
Incorrect start of type??
import java.util.Random; public class Program { public static void main(String[] args) { Random rnd = new Random (); int you = rnd.nextInt (6); int AI = rnd.nextInt (6); System.out.println("You: " + you); System.out.println("Opponent: " + AI); if(you>AI) System.out.println("You won!"); } else { System.out.println("you lost"); } } Apparantly the else is an incorrect start of type? Can you please help?
2 Antworten
+ 4
You lack an opening curly brace on if statement.
if (you>AI) {
+ 1
... Why didn’t I see that! Thanks soooo much!