帮忙看下!Strsex.equals("")什么意思
public class studenttest{
public static void main (String[] args)
{
studenttest tom = new studenttest(/*"Tom","200202410"*/);
tom.setstudentname("Tom");
tom.setstudentnumber("200202410");
tom.setstudentsex("man");
tom.setstudentaddress("American");
tom.setstudentbirthday("1990.07.24");
tom.setstudentspeciality("电子信息科学与技术");
System.out.println(tom.toString());
}
/*class student
{*/
private String Strname;//学生姓名
private String Strnumber;//学号
private String Strsex;//性别
private String Strbirthday;//出生年月
private String Strspeciality;//专业
private String Straddress;//地址
/*public student(String name,String number)
{
Strname=name;
Strnumber=number;
}
*/
/*public String getstudentname()
{
return Strname;
}*/
public void setstudentname(String name)
{
Strname=name;
}
/*public String getstudentnumber()
{
return Strnumber;
}
*/
public void setstudentnumber(String number)
{
Strnumber=number;
}
/*public String getstudentsex()
{
return Strsex;
}*/
public void setstudentsex(String sex)
{
Strsex=sex;
}
/*public String getstudentbirthday()
{
return Strbirthday;
}
*/
public void setstudentbirthday(String birthday)
{
Strbirthday=birthday;
}
/*public String getstudentspeciality()
{
return Strspeciality;
}
*/
public void setstudentspeciality(String speciality)
{
Strspeciality=speciality;
}
/*public String getstudentaddress()
{
return Straddress;
}*/
public void setstudentaddress(String address)
{
Straddress=address;
}
public String toString()
{
String information=" ";/*= "学生姓名=" + Strname + ",学号=" +Strnumber;*/
if( !Strname.equals(""))
information += "姓名=" + Strname;
if( !Strnumber.equals(""))
information += ",学号=" + Strnumber;
if( !Strsex.equals(""))
information += ",性别=" + Strsex;
if( !Strbirthday.equals(""))
information += ",出生年月=" + Strbirthday;
if( !Strspeciality.equals(""))
information += ",专业=" + Strspeciality;
if( !Straddress.equals(""))
information += ",籍贯=" + Straddress;
return information;
}
}
帮忙看下
if( !Strname.equals("") )
information += "姓名=" + Strname;
里的!Strname.equals("")什么意思
本人菜鸟,求大侠赐教,谢谢