下面是我的代码,它抛出了编译时错误。
import Java.util.Scanner;
class gucci{
public static void main(String args[]){
Scanner ice = new Scanner(System.in);
int lost = 5;
int sauce = 18;
lost++;
System.out.println(lost);
Stytem.out.println(lost);
}
}
这里的代码有什么问题?
答案 0 :(得分:-1)
import Java.util.Scanner;
^
应该是
import java.util.Scanner;
和
Stytem.out.println(lost);
^^
应该是
System.out.println(lost);
答案 1 :(得分:-1)
请找到正确的。比较代码以便更好地理解:
import java.util.Scanner; // not the Java.util.Scanner
public class Gucci{
public static void main(String args[]){
Scanner ice = new Scanner(System.in);
int lost = 5;
int sauce = 18;
lost++;
System.out.println(lost);
System.out.println(lost); // not the Stytem.out.println(lost);
}
}