class?Student{
專注于為中小企業(yè)提供成都網(wǎng)站建設、網(wǎng)站設計服務,電腦端+手機端+微信端的三站合一,更高效的管理,為中小企業(yè)關嶺免費做網(wǎng)站提供優(yōu)質的服務。我們立足成都,凝聚了一批互聯(lián)網(wǎng)行業(yè)人才,有力地推動了數(shù)千家企業(yè)的穩(wěn)健成長,幫助中小企業(yè)通過網(wǎng)站建設實現(xiàn)規(guī)模擴充和轉變。
private?String?name;
private?int?age;
private?String?degree;
public?Student(String?name,?int?age,?String?degree)?{
super();
this.name?=?name;
this.age?=?age;
this.degree?=?degree;
}
public?Student()?{
super();
}
public?String?getName()?{
return?name;
}
public?void?setName(String?name)?{
this.name?=?name;
}
public?int?getAge()?{
return?age;
}
public?void?setAge(int?age)?{
this.age?=?age;
}
public?String?getDegree()?{
return?degree;
}
public?void?setDegree(String?degree)?{
this.degree?=?degree;
}
public?void?show(){
System.out.println("姓名:"?+?this.getName()?+?".?年齡:"?+?this.getAge()?+?".?學位:"?+?this.getDegree()?);
}
}
class?Undergraduate?extends?Student{
private?String?specialty;
public?String?getSpecialty()?{
return?specialty;
}
public?void?setSpecialty(String?specialty)?{
this.specialty?=?specialty;
}
public?Undergraduate(String?name,?int?age,?String?degree,?String?specialty)?{
super(name,?age,?degree);
this.specialty?=?specialty;
}
public?Undergraduate(String?name,?int?age,?String?degree)?{
super(name,?age,?degree);
}
public?void?show(){
System.out.println("姓名:"?+?this.getName()?+?".?年齡:"?+?this.getAge()?+?".?學位:"?+?this.getDegree()?+?".?專業(yè):"?+?this.getSpecialty());
}
}
class?Graduate?extends?Student{
private?String?direction;
public?String?getDirection()?{
return?direction;
}
public?void?setDirection(String?direction)?{
this.direction?=?direction;
}
public?Graduate(String?name,?int?age,?String?degree,?String?direction)?{
super(name,?age,?degree);
this.direction?=?direction;
}
public?Graduate(String?name,?int?age,?String?degree)?{
super(name,?age,?degree);
}
public?void?show(){
System.out.println("姓名:"?+?this.getName()?+?".?年齡:"?+?this.getAge()?+?".?學位:"?+?this.getDegree()?+?".?研究方向:"?+?this.getDirection());
}
}
public?class?exp1401?{
public?static?void?main(String[]?args)?{
Undergraduate?stu1=new?Undergraduate("張三",23,"本科","工業(yè)自動化");
Graduate?stu2=new?Graduate("李四",27,"碩士","網(wǎng)絡技術");
stu1.show();
stu2.show();
}
}
1.對象
6.java命令加上的java源文件 3個字節(jié)碼文件
7,重寫 重載、
10.GridLayout
三。
1.文件名為 A.java
2. x str
3.n%k == 0
public class Main {
public static void main(String[] args) {
Test test = new Test(true);
}
}
class Test {
public Test(){
System.out.println("Constructor one invoked!");
}
public Test(int x){
//此處添加代碼
Test();
System.out.println("Constructor two invoked!");
}
public Test(boolean b){
//此處添加代碼
Test(1);
System.out.println("Constructor three invoked!");
}
}
本文名稱:填空題java源代碼,java程序編程填空題及答案
本文地址:http://chinadenli.net/article16/dsicsdg.html
成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供搜索引擎優(yōu)化、靜態(tài)網(wǎng)站、網(wǎng)站收錄、建站公司、做網(wǎng)站、網(wǎng)頁設計公司
聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)