Advertisement
Guest User

Main

a guest
Jan 24th, 2018
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1.  
  2. public class Auto {
  3.  
  4.  
  5. private String znacka;
  6. private String typ;
  7. private int cena ;
  8. private double spotreba;
  9.  
  10.  
  11. public void setZnacka(String znacka) {
  12. this.znacka = znacka;
  13. }
  14. public String getZnacka() {
  15. return this.znacka;
  16. }
  17.  
  18.  
  19.  
  20. public void setTyp(String typ) {
  21. this.typ = typ;
  22. }
  23. public String getTyp() {
  24. return this.typ;
  25. }
  26.  
  27.  
  28.  
  29. public void setCena(int cena) {
  30. this.cena = cena;
  31. }
  32. public int getCena() {
  33. return this.cena;
  34. }
  35.  
  36.  
  37.  
  38. public void setSpotreba(double spotreba) {
  39. this.spotreba = spotreba;
  40. }
  41. public Double getSpotreba() {
  42. return this.spotreba;
  43. }
  44.  
  45.  
  46. public Auto () {
  47. this.znacka = "NoName";
  48. this.typ = "NoThing";
  49. this.cena= 0;
  50. this.spotreba = 0;
  51. }
  52.  
  53.  
  54. public Auto(String znacka, String typ, int cena, double spotreba)
  55. {
  56. this.znacka = znacka;
  57. this.typ = typ;
  58. this.cena = cena;
  59. this.spotreba = spotreba;
  60. }
  61.  
  62. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement