总是一个出错
package plan;public class TestScan
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
while(sc.hasNext())
{
System.out.println("输出为:"+sc.hasNext());
}
}
}
总是抱错错啊说是 Scanner 未找到 怎么回事啊 我也没有写错啊
----------------解决方案--------------------------------------------------------
在前面加一句
import java.util.Scanner; //导入Scanner 类
程序代码:
package plan;
import java.util.Scanner; //导入Scanner 类
public class TestScan
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
while(sc.hasNext())
{
System.out.println("输出为:"+sc.hasNext());
}
}
}
import java.util.Scanner; //导入Scanner 类
public class TestScan
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
while(sc.hasNext())
{
System.out.println("输出为:"+sc.hasNext());
}
}
}
----------------解决方案--------------------------------------------------------
以下是引用lampeter123在2011-4-6 08:24:09的发言:
在前面加一句
import java.util.Scanner; //导入Scanner 类package plan;
import java.util.Scanner; //导入Scanner 类
public class TestScan
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
while(sc.hasNext())
{
System.out.println("输出为:"+sc.hasNext());
}
}
}
非常感谢` 在前面加一句
import java.util.Scanner; //导入Scanner 类package plan;
import java.util.Scanner; //导入Scanner 类
public class TestScan
{
public static void main(String[] args)
{
Scanner sc=new Scanner(System.in);
while(sc.hasNext())
{
System.out.println("输出为:"+sc.hasNext());
}
}
}
----------------解决方案--------------------------------------------------------