parent
8428ddffb2
commit
75b54e74f5
|
|
@ -0,0 +1,13 @@
|
|||
Zum nachlesen.
|
||||
|
||||
Java OOP
|
||||
Bro Code - Java Full course for free 2025
|
||||
https://www.youtube.com/watch?v=xTtL8E4LzTQ
|
||||
|
||||
|
||||
W3-Schools - Java Encapsulation
|
||||
Get and Set
|
||||
https://www.w3schools.com/java/java_encapsulation.asp
|
||||
|
||||
Code Gym - Get and Set
|
||||
https://codegym.cc/de/groups/posts/getter-und-setter-in-java
|
||||
|
|
@ -1,13 +1,18 @@
|
|||
package shoppackage;
|
||||
//Überlegen ob etwas private sein soll oder nicht
|
||||
//Setter und getter erlernen falls private <---- Nacht darüber schlafen.
|
||||
/*
|
||||
TODO
|
||||
Setter getter tutorial schauen
|
||||
|
||||
|
||||
|
||||
*/
|
||||
public class Product {
|
||||
int prodID;
|
||||
String name;
|
||||
double transportWeight;
|
||||
double netto;
|
||||
double mwst;
|
||||
int lagerbestand;
|
||||
private int prodID;
|
||||
private String name;
|
||||
private double transportWeight;
|
||||
private double netto;
|
||||
private double mwst; // <----- Maybe final setzen
|
||||
private int lagerbestand;
|
||||
|
||||
public Product(int prodID, String name, double transportWeight, double netto, double mwst, int lagerbestand) {
|
||||
this.prodID = prodID;
|
||||
|
|
@ -28,7 +33,7 @@ public class Product {
|
|||
|
||||
return true;
|
||||
}
|
||||
//
|
||||
//Get ---> Methoden zum abrufen der Vals
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
|
@ -49,4 +54,7 @@ public class Product {
|
|||
public double getTransportWeight(){
|
||||
return transportWeight;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
Loading…
Reference in New Issue