Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package Bai2_Ws;
- public class Consumer extends Thread {
- Store xStore = null;
- public Consumer(Store xStore) {
- this.xStore = xStore;
- }
- @Override
- public void run() {
- while (true) {
- try {
- int xResult = xStore.get();
- if (xResult > 0) {
- System.out.println("** BOUGHT : product " + xResult);
- } else {
- System.out.println("==Customer is waiting for new products==");
- }
- } catch (Exception e) {
- System.out.println(e);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement