There are two classes. One, X
, has it's own blockingQueue and also method returning it:
public int getQueue(){
return TaskQueue;
}
but it seems it returns queue's reference. And I need to operate on it in other class Y
where there is x.getQueue().take();
. So is there any way to pass queue with getters / setters ?