<2008年10月>
          2829301234
          567891011
          12131415161718
          19202122232425
          2627282930311
          2345678

          統(tǒng)計(jì)

          • 隨筆 - 84
          • 文章 - 1
          • 評(píng)論 - 2
          • 引用 - 0

          常用鏈接

          留言簿(3)

          隨筆分類(lèi)

          隨筆檔案

          文章檔案

          搜索

          •  

          最新評(píng)論

          • 1.?re: jsp讀取*.TXT
          • 請(qǐng)問(wèn) retstr是什么數(shù)據(jù)類(lèi)型?String?好像不行哦
          • --jsp
          • 2.?re: StudentTest1.java
          • 看不懂你的意思,代碼沒(méi)有縮進(jìn),看著很不習(xí)慣那。
          • --楊?lèi)?ài)友

          閱讀排行榜

          評(píng)論排行榜

          StudentTest.java
          /*
          *學(xué)生類(lèi),包括學(xué)生類(lèi)的基本信息
          */
          public class StudentTest{
          public static void main(String[] args)
          {
          Student tom=new Student("Tom","20020410");
          tom.setStudentSex("man");
          tom.setStudentAddress("America");
          System.out.println(tom.toString());
          }
          }
          class Student{
          private String strName=";
          private String strNumber="";
          private String strSex="";
          private String strSpeciality="";
          private String strAddress="";
          public Student(String name,String number){
          strName=name;
          strNumber=number;
          }
          public String getStudentName(){
          return strName;
          }
          public String getStudentNumber(){
          return strNumber;
          }
          public String getStudentSex(){
          return strStudentSex;
          }
          public String 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(){
          strSpeciality=speciality;
          }
          public String getStudentAddress(){
          return strAddress;
          }
          public void setStudentAddress(String address){
          strAddress=address;
          }
          public String toString(){
          String information ="student name="+strName+",student number ="+strNumber;
          if(!strSex.equals(""))
          information+=",sex="+strSex;
          if(!strBirthday.equals(""))
          information+=",birthday ="+strBirthday;
          if(!strAddress.equals(""))
          information+=",address="+strAddress;
          return information;
          }

          }

          }

          posted on 2008-10-21 18:16 郭興華 閱讀(217) 評(píng)論(0)  編輯  收藏


          只有注冊(cè)用戶(hù)登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 无棣县| 苍南县| 赫章县| 昭苏县| 奎屯市| 赣榆县| 冀州市| 卫辉市| 通化县| 界首市| 九江市| 隆昌县| 陕西省| 大同县| 灵石县| 福清市| 滨海县| 宁河县| 满洲里市| 宁波市| 桓仁| 隆子县| 静宁县| 乌什县| 应城市| 江阴市| 长武县| 漳浦县| 赞皇县| 大冶市| 平潭县| 会东县| 金坛市| 韶山市| 伊宁县| 河北省| 娱乐| 宝坻区| 罗城| 新巴尔虎左旗| 顺平县|