一个判断性别的程序,求哪位大大进来看下错在哪?
//如果是男就输出这个名字.
//如果是女就不输出这个名字.
import java.util.Scanner;
public class pd{
public ststic void main(sting[] arge){
string name="";
system.out.print("请输入姓名");
Scanner scanner=new Scanner(System.in);
name=scanner.nextInt();
string sex="";
system.out.print("请输入性别");
Scanner scanner=new Scanner(System.in);
sex=scanner.nextInt();
if(sex!="男"&&sex!="女")
{
System.out.print("Are you kidding me?!!");
}
else if(sex=="男")
{
System.out.print("姓名:"+name,"性别:"+sex);
}
};
}
提示我 //如果是女就不输出这个名字.
import java.util.Scanner;
public class pd{
public ststic void main(sting[] arge){
string name="";
system.out.print("请输入姓名");
Scanner scanner=new Scanner(System.in);
name=scanner.nextInt();
string sex="";
system.out.print("请输入性别");
Scanner scanner=new Scanner(System.in);
sex=scanner.nextInt();
if(sex!="男"&&sex!="女")
{
System.out.print("Are you kidding me?!!");
}
else if(sex=="男")
{
System.out.print("姓名:"+name,"性别:"+sex);
}
};
}
pd.java:5: <identifier>expected
public ststic void main(sting[] arge){
^
1 error
这是什么情况啊 ? 哪位大大给讲解下?