Guest User

Untitled

a guest
Jan 15th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. public class Student {
  2.  
  3. private final String studentName;
  4. private final int rollNo;
  5. private int grade;
  6. private Book book;
  7. public boolean issuedBook;
  8. List<Student> student = new ArrayList<>();
  9.  
  10. Map<Student, List<Book>> bookIssued = new HashMap<>();
  11.  
  12. public Student(String studentName, int rollNo) {
  13. this.studentName = studentName;
  14. this.rollNo = rollNo;
  15.  
  16. }
  17.  
  18.  
  19. public void setGrade(int grade) {
  20. this.grade = grade;
  21. }
  22.  
  23. public String getName() {
  24. return studentName;
  25. }
  26.  
  27. public int getRollNo() {
  28. return rollNo;
  29. }
  30.  
  31. public int getGrade() {
  32. return grade;
  33. }
  34. }
  35.  
  36.  
  37. //Book class
  38.  
  39. public class Book {
  40.  
  41. private String[] bookName = {"Math", "English"};
  42. private boolean bookIssued;
  43.  
  44. public boolean issueBook(Student student) {
  45. if (!student.issuedBook) {
  46. return false;
  47. }
  48. return true;
  49. }
  50.  
  51. }
Add Comment
Please, Sign In to add comment