![]() すべてのクラスは Object | |
class Personnote:
{
public 文字列名;
public 文字列アドレス。
}
class Employee extends Person
{
int salary;
public Employee(文字列名, 文字列アドレス, int salary)
{
this.name=name;
this.address=address;
this.salary=salary;
}
}
class Director extends Person
{
public Director()
{
this.name= "name";
this.adresse= "アドレス";
}
}
class Engineer extends Employee
{
public Engineer()
{
super("name","address",110);
}
public void concevoir(){System.out.println("私はエンジニアです");}
public void developper(){};
}
class Accountant extends Employee
{
public Accountant()
{
this.name= "name";
this.adresse= "アドレス";
this.salary = 3000;
}
public void manageAccounts(){};
public void gererLesBilans(){};
}
class Ingenieur_reseaux extends Employeesuper がない場合、コンストラクタIngénieur_réseauxで宣言された design() メソッドが engineer で宣言された design() メソッドの代わりに呼び出されるため、親メソッドを参照するにはキーワードを追加する必要があります super.
{
public Ingenieur_reseaux ()
{
super("name","address",3100);
}
public void concevoir(){
super.concevoir();
System.out.println("会社のネットワークアーキテクチャを設計しました");
}
}
私はエンジニアです
会社のネットワークアーキテクチャを設計しました
interface print{
void print();
}
インターフェイス display{
void display();
}
interface interfaceIA extends print,display{
void imprimer_afficher();
}
class testIA implements interfaceIA{
void print(){System.out.println("Printing")};
void display(){System.out.println("印刷完了")};
public static void main(){
testIA test = new testIA();
test.print();
test.display();
}
}
Please disable your ad blocker and refresh the window to use this website.