package just;
import Learn.LearnFunc;
import java.util.Scanner;
public class importextends extends LearnFunc {
void test()
{
Scanner tmp=new Scanner(System.in);
System.out.println("使用next方法");
if(tmp.hasNextLine())
{
String s=tmp.nextLine();
System.out.println("输出的内容为"+s);
}
tmp.close();
}
}
关键是Learn.LearnFunc这个包里已经有了import java.util.Scanner;这条语句,这里我已经把Learn.LearnFunc导入了,为什么Idea还会帮我自动添加import java.util.Scanner;呢?