『壹』 java面向對象程序設計實驗報告怎麼寫
1。People.java
public class People {
//性別(sex)及出生日期(date);方法成員有:獲取人的性別和出生日期及構造方法。要求構造方法可以設置性別和出生日期的初始值。
private int sex;
private Date birth;
public People (int sex, Date birth) {
this.sex = sex;
this.birth = birth;
}
public int getSex() {
return this.sex;
}
public Date getBirth() {
return this.birth;
}
}
2。Student.java
public class Student extends People{
private int sex;
private Date birth;
private String name;
private int stuno;
private double grate;
private String studentNative;
public Student(int sex, Date birth, String name, int stuno, double grate, String studentNative) {
super(sex, birth);
this.name = name;
this.stuno = stuno;
this.grate = grate;
this.studentNative = studentNative;
}
public Date getBirth() {
return birth;
}
public double getGrate() {
return grate;
}
public String getName() {
return name;
}
public int getSex() {
return sex;
}
public String getStudentNative() {
return studentNative;
}
public int getStuno() {
return stuno;
}
}
3。測試類自己編寫就好了,創建一個People和Student的對象,然後設置值,取值就可以了。
五。
1.構造方法沒有返回值,方法名和類名一樣.
2.繼承是指子類可以擁有父類的方法和屬性;多態是指父類的引用可以指向子類對象的實例
3.重寫
4.重載
『貳』 基於java web的圖書管理系統的設計與實現的開題報告怎麼寫
開題報告按照任務書,設計相關模塊,通過具體概要設計進行編寫。程序可以幫寫。