如何在优先级java中插入长数据类型
我想将所有long
键入优先级队列键入整数,我想
PriorityQueue<long> pQueue = new PriorityQueue<>();
在java collections中有一个替代方案来实现类似的东西,以实现类似的东西吗?
I want to store all long
type integer to a priority queue, and I want to intialize the queue something like this
PriorityQueue<long> pQueue = new PriorityQueue<>();
Is there an alternative available in java collections to achieve something like this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Java不允许仿制药中的原始类型。您必须使用下面的包装类课程。
Java doesn't allow primitive types in generics. You must use wrapper class like below.