Ubgrade 10.12

master
freverda 2022-12-10 20:45:34 +01:00
parent 49311107b7
commit c1863c88a4
2 changed files with 6 additions and 3 deletions

View File

@ -7,12 +7,13 @@
*/
public class Ausgabe
{
public void MercedesAusgabe(){
private int Sitze;
public void MercedesAusgabe(int s){
Fahrzeug Mercedes = new Fahrzeug(140, 4);
Mercedes.getGeschwindigkeit(80);
Sitze = s;
Mercedes.Ausgabe();
System.out.println("Sitze: "+ Sitze);
}
public void FerrariAusgabe(){

View File

@ -13,6 +13,7 @@ public class Fahrzeug
private int Geschwindigkeit;
private int Maximal;
private int Räder;
public Fahrzeug(int m, int r){
Geschwindigkeit = 0;
@ -20,6 +21,7 @@ public class Fahrzeug
Räder = r;
}
public int getGeschwindigkeit(int g){
Geschwindigkeit = g;
if(Geschwindigkeit > Maximal){