我創建了2個班級,我想在B級方法中使用A級
創建了A級級別 我使用保護因爲我創建了一個超在我的代碼,不介意它我創建了2個班級,我想要使用B級方法中的A級
public class A {
protected String modulname;
protected String verantwortliche;
protected int sws;
protected int credits;
public A (String modulname, String verantwortliche, int sws, int credits){//beginning of the methode of class A
this.modulname =modulname;
this.verantwortliche = verantwortliche;
this.sws= sws;
this.credits = credits;
}
public class B {
private String pruefer;
private double leistungeninprozent;
//i want to use the Attributes/Constructors form class A in the class B
//an put it like this:
public B (class A, String pruefer, double
leistungeninprozent){
this.leistungeninprozent = leistungeninprozent;
this.modul = modul;
this.pruefer = pruefer;
}