logo

Crowdly

Browser

Add to Chrome

What statements about the following class definition are true ? ( Choose a...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

What statements about the following class definition are true? (Choose all that apply.)

public class TicketManager {

private TicketManager() { super(); }

private static TicketManager instance;

public static synchronized TicketManager getInstance() { // k1

if (instance == null) instance = new TicketManager(); // k2

return instance;

}

private int tickets;

public int getTicketCount() { return tickets; }

public void makeTicketsAvailable(int value) { tickets += value; } // k3

public void sellTickets(int value) {

synchronized (this) { // k4

tickets -= value;

}

}

}

0%
0%
100%
0%
0%
100%
More questions like this

Want instant access to all verified answers on dl.nure.ua?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome