java student类_student 1.编写一个学生类 ,包含的属性有:学号(String类型)、姓名 别( Java Develop 238万源代码下载- www.pudn.com...

详细说明:1.编写一个学生类Student,包含的属性有:学号(String类型)、姓名(String类型)、性别(String)、年龄(int);方法有: say()返回类型是void ,功能是向屏幕打印一行字“I am a Student!”。

2.在上题的基础上,编写一个类TestStudent实现学生对象的添加,在main方法中增加Student对象,编写程序完成以下功能:

1) 增加学生, “姓名:张三、学号:0001、性别:男、年龄:22。”

2) 分别输出张三的学号,姓名,性别,年龄

3.编写一个课程类Course,包含的属性有:课程编号(int类型),课程名(String类型) 。包含方法:设置课程、获得课程。

4.在Student类中添加一个属性:课程(Course类)

在类TestStudent中添加一个学生信息如下

“课程编号:1;课程名称:java; 姓名:张三 ;学号:0001; 性别:男 ;年龄:22。”

5.在Student类中添加构造方法初始化所有属性。提示:参考讲过的Person类

-Writing student class Student contains attributes: student number (String type), name (String type), gender (String), age (int) method: say () return type is void, the function is toscreen print his words "I am a Student!".

On the theme based on a class TestStudent students object to add to increase Student object in the main method, write a program to perform the following functions:

1) increasing the number of students, "Name: Joe Smith, student number: 0001, Gender: Male, Age: 22."

2) Output seating the student number, name, sex, age.

Write a curriculum classes Course contains attributes: Course ID (int type), course name (String type). Contains: curriculum, access to courses.

4 in the Student class to add a property: Course (Course)

Add a student in class TestStudent below

Course Code: 1 Course Name: java name: Joe Smith Student ID: 0001 Gender: Male Age: 22. "

Add a constructor to initialize all of the properties in the Student class. Hint: spoken Person class

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值