Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Student {
- private String studentName;
- public Student(String studentName) {
- this.studentName = studentName;
- }
- public String getStudentName() {
- return studentName;
- }
- }
- //Book class
- public class Book {
- private String bookName;
- private boolean borrowed;
- public Book(String bookName) {
- this.bookName = bookName;
- }
- public void borrowed() {
- borrowed = true;
- }
- public void bookReturned() {
- borrowed = false;
- }
- public boolean isBorrowed() {
- if (borrowed) {
- return true;
- }
- return false;
- }
- }
Add Comment
Please, Sign In to add comment