Hallo
versuche eine Klasse Kontofuehrung mit den Eigenschaften: Kontoinhaber, Kontostand, Kontonr und Kontoauszug zu schreiben. Aber er gibt mir folgende Fehlermeldung:
Kontofuehrung.java:9: <identifier> expected
kontoinhaber = inhaber;
^
Kontofuehrung.java:10: <identifier> expected
kontostand = stand;
^
Kontofuehrung.java:11: <identifier> expected
kontonummer = nr;
kann mir jemand helfen? Was habe ich falsch gemacht und wie mache ich es richtig?
versuche eine Klasse Kontofuehrung mit den Eigenschaften: Kontoinhaber, Kontostand, Kontonr und Kontoauszug zu schreiben. Aber er gibt mir folgende Fehlermeldung:
Kontofuehrung.java:9: <identifier> expected
kontoinhaber = inhaber;
^
Kontofuehrung.java:10: <identifier> expected
kontostand = stand;
^
Kontofuehrung.java:11: <identifier> expected
kontonummer = nr;
kann mir jemand helfen? Was habe ich falsch gemacht und wie mache ich es richtig?
Java:
class Kontofuehrung {
public String kontoinhaber;
public float kontostand = 0;
public long kontonummer;
public Kontofuehrung(String inhaber,float stand, long nr);
kontoinhaber = inhaber;
kontostand = stand;
kontonummer = nr;
void einzahlen(double betrag) {
kontostand += betrag;
}
void abheben(double betrag) {
kontostand -= betrag;
}
void print() {
System.out.println("Kontoinhaber " + kontoinhaber + " Kontostand " + kontostand + "Kontonr. " + kontonummer);
}
public static void main(String[] args) {
Kontofuehrung name1 = new Kontofuehrung("Maier", 0, 1234);
name1.einzahlen(1000);
name1.print();
}
}