[求助]Scanner怎么用?
要求写一程序,当输入为7时输出一段代码,为8是输出别一段代吗
import java.util.Scanner;
public class Scanner1{
public static void main(String []args)
{
Scanner1 North;
Scanner1 South;
North=new Scanner1();
South=new Scanner1();
Scanner scan=new Scanner(System.in);
if(scan=7)
North.One();
if(scan=8)
South.Two();}
public void One{
System.out.println("dfdfd");
}
public void Two{
System.out.println("dfdfdfdfd");
}
}
错误提示为:
Scanner1.java:15: '(' expected
public void One{
^
1 error
不知道错在哪,请各位教教俺.