Java队列实现(Java Queue Implementation)
我是Java新手并尝试使用:
public static ArrayBlockingQueue<String> qu=new ArrayBlockingQueue<>(900); ... qu.enqueue(MyString);
要么
public static Queue<String> qu=new Queue<>(900); ... qu.enqueue(MyString);
队列尖叫,声称它只是一个界面。 ArrayBlockingQueue不接受入队。 我觉得我犯了一些基本错误。 我的问题是:每次使用它时,我是否必须编写自己的Queue来实现接口,或者是否有就绪函数? 如果是的话,我做错了什么? 我的第二个问题是:什么是标准队列大小? 根据我读过的规格,我认为它必须是我可能使用的最大值,但对于小型应用来说,900不是一个很大的空间接受者吗?
I am new to Java and trying to use:
public static ArrayBlockingQueue<String> qu=new ArrayBlockingQueue<>(900); ... qu.enqueue(MyString);
or
public static Queue<String> qu=new Queue<>(900); ... qu.enqueue(MyString);
Queue screams,claiming it's only an interface. ArrayBlockingQueue does not accept enqueue. I feel I'm making some basic mistake. My question is: do I have to write my own Queue implementing the interface every time I use it or is there a ready function? If yes, what am I doing wrong? My second question is: what is a standard queue size? From the specifications I've read I assumed it must be the maximum I may use but isn't 900 a bit big space-taker for a small application?
原文:https://stackoverflow.com/questions/17624191
满意答案
为了增加aku的优秀答案,对于说英语的人,可以在http://www.hex-rays.com/上找到IDA Pro。
To add to aku's excellent answer, for English speakers, IDA Pro is available at http://www.hex-rays.com/.
相关问答
更多VC ++的开头[关闭](Beginnings of VC++ [closed])
使用:: InterlockedIncrement(VC ++)的唯一ID(Unique ID with ::InterlockedIncrement (VC++))
这些天使用VC ++?(Uses of VC++ these days?)
将VC 6.0应用程序移植到VS 2003 VC ++应用程序(Porting VC 6.0 Application to VS 2003 VC++ application)
如何在VC ++中获取WPF应用程序的屏幕截图?(How to get screenshot of WPF application in VC++?)
使用CPPUNIT或GTEST对VC ++ MFC应用程序进行单元测试(Unit testing VC++ MFC application using CPPUNIT or GTEST)
如何反汇编VC ++应用程序?(How do I disassemble a VC++ application?)
.NET VC ++ Redist依赖(.NET VC++ Redist dependency)
如何在Metro应用程序中写入控制台/登录VC ++?(How to write to console/log in VC++ in a Metro app?)
相关文章
更多Hadoop mapred-queue-acls 配置
java 监听redis过期key事件实现延迟队列功能
Java 异常处理
RabbitMQ 简单队列
java顺序循环队列最多能容纳60个元素,当front=47,rear=23时,求队列元素个数?
RabbitMQ Work模式消息队列
Java企业级应用软件开发
Java Bug模式详解
广州Java培训疯狂Java基础强化营视频教程
Open Source Search Engines in Java
最新问答
更多您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
在计算机拍照在哪里进入
使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
单页应用程序:页面重新加载(Single Page Application: page reload)
在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!