Advertisement
Guest User

Book

a guest
Nov 23rd, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. public class Book {
  2. //מאפייני כל הספרים
  3. private String name;
  4. private double price;
  5. // פעולה בונה
  6. public Book(String name, double price){
  7. this.name = name;
  8. this.price = price;
  9. }
  10. //פעולה מאחזרת של שם של הספר
  11. public String getname(){
  12. return this.name;
  13. }
  14. //פעולה מאחזרת של מחיר הספר
  15. public double getprice(){
  16. return this.price;
  17. }
  18. //פעולה מעדכנת של שם הספר
  19. public void setname(String name){
  20. this.name = name;
  21. }
  22. //פעולה מעדכנת של מחיר הספר
  23. public void setprice(double price){
  24. this.price = price;
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement