Question 20
Consider the code given below.
class Stock{ int available = 40; public synchronized void request(String uname, int n){ if(available >= n){ available = available - n; System.out.println(uname + " ordered " + n + " item(s)"); } else System.out.println(uname + " cannot order " + n + " item(s)"); }}class Order implements Runnable{ Stock st; String username; int nItems; public Order(Stock s, String u, int n){ st = s; username = u; nItems = n; } public void run(){ st.request(username, nItems); }}public class Test { public static void main(String[] args) { Stock stk = new Stock(); Order od1 = new Order(stk, "Ram", 15); Order od2 = new Order(stk, "Sita", 30); Thread t1 = new Thread(od1); Thread t2 = new Thread(od2); t1.start(); t2.start(); }}From among the options given below, which are possible outputs of the given code?