已阅读5页,还剩1页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
定义学生类JAVA程序设计class student protected String studentNumber=null; protected String name=null; protected String sex; protected int age=1; protected String nation=null; protected String sg=null; protected String phoneNumber; protected String email; protected String speciality; protected String score; protected String tz; protected String adress; protected String birthday; protected String classRoom; public void setStudentNumber(String studentNumber) this.studentNumber=studentNumber; public String getStudentNumber() return studentNumber; public void set(String name)/修改姓名 =name; public String getName() /获得姓名 return name; public void setSex(String sex) this.sex=sex; public String getSex() return sex; public void set(int age) this.age=age; public int getAge() return age; public void setNation(String nation) /设置民族 this.nation=nation; public String getNation() /获取民族 return nation; public void setSg(String sg) this.sg=sg; public String getSg() return sg; public void setPhoneNumber(String phoneNumber) this.phoneNumber=phoneNumber; public String getPhoneNumber() return phoneNumber; public void setEmail(String email) this.email=email; public String getEmail() return email; public void setSpeciality(String speciality) this.speciality=speciality; public String getSpeciality() return speciality; public void setScore(String score) /设置分数 this.score=score; public String getScore() /获得分数 return score; public void setTz(String tz) this.tz=tz; public String getTz() return tz; public void setAdress(String adress) this.adress=adress; public String getAdress() return adress; public void setBirthday(String birthday) this.birthday=birthday; public String getBirthday() return birthday; public void setClassRoom(String classRoom) this.classRoom=classRoom; public String getClassRoom() returnclassRoom; class MyDate extends student private int year,month,day; private static int thisYear; static thisYear=2009; public MyDate(int year,int month,int day) this.set(year,month,day); public MyDate() this(1991,1,5); public MyDate(MyDate d) this.set(d); public void set(int y,int m,int d) this.year=y;this.month=(m=1)&(m=1)&(d=31)?d:1; public void set(MyDate d) set(d.year,d.month,d.day); public int getyear() return this.year; public int getMonth() return this.month; public int getDay() return this.day; public String toString() return year+年+month+月+day+日; public static int getThisYear() return thisYear; public static boolean isLeapYear(int year) return year%400=0|year%100!=0&year%4=0; public boolean isLeapYear() return isLeapYear(this.year); public static void main(String args) MyDate d=new MyDate(); d.set(1991,1,5); student a=new student(); d.studentNumber=20091103101; =单祖超; d.sex=男; d.age=19; d.nation=汉族; d.sg=172; d.phoneNumber d.email=996203097; d.speciality=电子商务; d.score=无; d.adress=经济技术开发区大学路1号昆明学院计算机与网络技术系; d.birthday=1991年1月; d.classRoom= 惟实楼; System.out.print(我的学号为:); System.out.println( d.getStudentNumber(); System.out.print(我的姓名为:); System.out.println(d.getName(); System.out.print(我的性别为:); System.out.println(d.getSex(); System.out.print(我的年龄为:); System.out.println(d.getAge(); System.out.print(我的民族为:); System.out.println(d.getNation(); System.out.print(我的身高为:); System.out.println(d.getSg()+cm); System.out.print(我的电话为:); System.out.println(d.getPhoneNumber(); System.out.print(我的邮箱为:); System.out.println(d.getEmail(); System.out.print(我的专业为:); System.out.println(d.getSpeciality(); System.out.print(我的分数为:); System.out.println(d.getScore(); System.out.print(我的地址为:); System.out.println(d.getAdress(); System.out.print(我的生日为:); System.out.println(d.getBirthday(); System.out.println(我的出生日期:+d.toString()+ ,闰年?+d.isLeapYear(); System.out.print(上课地点为:); System.out.println(d.getClassRoom();- java -我的学号为:20091103101我的姓名为:单祖超我的性别为:男我的年龄为:19我的民族为
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026黑龙江齐齐哈尔市碾子山区公益性岗位笔试备考试题及答案详解
- 2026广东汕头市龙湖人民医院第一批招聘合同制专业技术人员26人笔试模拟试题及答案详解
- 2026年西安市雁塔区第一小学教师招聘备考题库完整参考答案详解
- 2026甘肃省农业科学院博士后科研工作站招聘博士后备考题库及一套答案详解
- 2026济南能源集团产业发展有限公司招聘3人备考题库及答案详解1套
- 2026春季安徽合肥市检验检测认证集团有限公司招聘21人备考题库完整答案详解
- 2026年度武汉纺织大学第三批合同制聘用人员招聘备考题库及答案详解1套
- 2026广西玉林市北流市人民医院赴广西医科大学双选会招聘专业技术人员28人备考题库及参考答案详解
- 2026浙江宁波原水有限公司招聘5人备考题库完整答案详解
- 2026北京大学心理与认知科学学院招聘劳动合同制人员1人备考题库及完整答案详解一套
- 2026年及未来5年中国水声设备市场前景预测及投资规划研究报告
- 1254《计算机组成原理》国家开放大学期末考试题库
- 2025福建三明宁化县高校毕业生服务社区计划招募5人备考题库附答案
- XX镇关心下一代工作委员会2025年上半年工作总结暨下半年工作部署报告
- 宣传视频制作服务项目技术规范书-采购技术文件规范模版
- 2026中国中化校园招聘(公共基础知识)测试题附答案解析
- SMT贴片机操作安全标准手册
- JS-008 房屋建筑工程和市政基础设施工程设计单位质量检查报告
- 真空钎焊及热处理操作指导书
- 磁共振3D-ASL课件教学课件
- 芯片工厂安全培训课件
评论
0/150
提交评论