Guest User

Untitled

a guest
Jan 15th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. public class Student {
  2.  
  3. private String studentName;
  4.  
  5. public Student(String studentName) {
  6. this.studentName = studentName;
  7. }
  8.  
  9. public String getStudentName() {
  10. return studentName;
  11. }
  12.  
  13. }
  14.  
  15. //Book class
  16.  
  17. public class Book {
  18.  
  19. private String bookName;
  20. private boolean borrowed;
  21.  
  22.  
  23. public Book(String bookName) {
  24. this.bookName = bookName;
  25. }
  26.  
  27. public void borrowed() {
  28. borrowed = true;
  29. }
  30.  
  31. public void bookReturned() {
  32. borrowed = false;
  33. }
  34.  
  35. public boolean isBorrowed() {
  36. if (borrowed) {
  37. return true;
  38. }
  39. return false;
  40. }
  41.  
  42. }
Add Comment
Please, Sign In to add comment