Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Student {
- private final String studentName;
- private final int rollNo;
- private int grade;
- private Book book;
- public boolean issuedBook;
- List<Student> student = new ArrayList<>();
- Map<Student, List<Book>> bookIssued = new HashMap<>();
- public Student(String studentName, int rollNo) {
- this.studentName = studentName;
- this.rollNo = rollNo;
- }
- public void setGrade(int grade) {
- this.grade = grade;
- }
- public String getName() {
- return studentName;
- }
- public int getRollNo() {
- return rollNo;
- }
- public int getGrade() {
- return grade;
- }
- }
- //Book class
- public class Book {
- private String[] bookName = {"Math", "English"};
- private boolean bookIssued;
- public boolean issueBook(Student student) {
- if (!student.issuedBook) {
- return false;
- }
- return true;
- }
- }
Add Comment
Please, Sign In to add comment