Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Java
Stumped. How to add a limit to a LinkedBlockingQueue
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Patricia Shanahan, post: 1920194"] Take a look at this, and see if it helps: import java.util.concurrent.LinkedBlockingQueue; public class ArrayTest { public static void main(String[] args) { MyQueue[] quarray = new MyQueue[5]; quarray[2] = new MyQueue(); for(int i=0; i<7; i++){ System.out.println(quarray[2].offer("Element "+i)); } } static class MyQueue extends LinkedBlockingQueue<String>{ MyQueue(){ super(5); } } } Obviously, you can use any number you like instead of "5". Patricia [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Java
Stumped. How to add a limit to a LinkedBlockingQueue
Top