在JAVA中随机初始化BitSet [英] Randomly initialize BitSet in JAVA

查看:123
本文介绍了在JAVA中随机初始化BitSet的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有必须随机初始化的BitSet.有什么方法可以做到吗?

I have BitSet which has to be initialized randomly. Is there any method to do that?

谢谢.

推荐答案

只需遍历BitSet并调用Random类的nextBoolean().

Just go through BitSet and call nextBoolean() of the Random class.

这篇关于在JAVA中随机初始化BitSet的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆