-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathUrun.java
38 lines (34 loc) · 851 Bytes
/
Urun.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
public class Urun {
//urun bilgileri
private int id;
private String isim;
private double stok;
private double fiyat;
//yapilandirici
public Urun(int id,String isim,double fiyat, double stok) {
this.id = id;
this.isim = isim;
this.stok = stok;
this.fiyat = fiyat;
}
//getter ve setterlar
public int getId() {
return this.id;
}
public String getIsim() {
return this.isim;
}
public double getStok() {
return this.stok;
}
public void setStok(double stok) {
this.stok = stok;
}
public double getFiyat() {
return this.fiyat;
}
@Override
public String toString() {
return "id: " + this.id + "\tisim: " + this.isim + "\tstok: " + this.stok + " kg\tfiyat: " + this.fiyat + " TL";
}
}