studenttest類用用於測試測試
public class Studenttest{對象
public static void main(String[] args){string
student stuli= new Student();//建立學生對象class
stuli, stuname="李明」;test
/訪問學生對象屬性static
stuli。seX="男";new
StuLi.age=18;void
stuli height = 178 5f;
stuli weight =40d;
student stuwang=new Student();
stuwang. stuname="王娜」;
string sex="女」;
stuwang. age =17;
stuwang. height =160 5f;
stuwang. weight =35;
}
}