Question 19
Consider the code given below.
class Library { private boolean isBookAvailable = true; public synchronized void borrowBook(String readerName) { if (isBookAvailable) { System.out.println(readerName + " borrowed the book."); isBookAvailable = false; } else { System.out.println(readerName + " could not borrow the book."); } }}class Reader implements Runnable { private Library library; private String readerName; public Reader(Library lib, String rn) { this.library = lib; this.readerName = rn; } public void run() { library.borrowBook(readerName); }}public class Test { public static void main(String[] args) { Library library = new Library(); Thread reader1 = new Thread(new Reader(library, "Rahul")); Thread reader2 = new Thread(new Reader(library, "Ram")); Thread reader3 = new Thread(new Reader(library, "Raghu")); reader1.start(); reader2.start(); reader3.start(); }}Which of the following options is/are possible result/s of the above code?