救命啊,哪错了,大侠帮看看啊
package xian;public class xian1{
public static void main(String[] args){
Scanner scanner = new Scanner(System.in);
System.out.print("请输入学生分数: ");
int scoreOfStudent = scanner.nextInt();
System.out.println("该生是否及格? " +
(scoreOfStudent >= 60 ? '是' : '否'));
}
}
错误显示,
Exception in thread "main" java.lang.Error: Unresolved compilation problems:
Scanner cannot be resolved to a type
Scanner cannot be resolved to a type
at xian.xian1.main(xian1.java:4)
搜索更多相关的解决方案:
输入问题
----------------解决方案--------------------------------------------------------
在package xian;后面加上:
import java.util.*;
----------------解决方案--------------------------------------------------------
应该是少了一些包了吧?
----------------解决方案--------------------------------------------------------
如果你用的是Eclipse,按一下Ctrl+Shift+O(字母O)就可以了
----------------解决方案--------------------------------------------------------
谢谢了,成了!!
----------------解决方案--------------------------------------------------------
少了包的引入啊
----------------解决方案--------------------------------------------------------
少了包的引入啊
----------------解决方案--------------------------------------------------------
少了import java.util.*;
此外,还要刨出IOException
----------------解决方案--------------------------------------------------------