[英]Converting boolean to BitSet in Java
所以我以前有這個:
public static final boolean opaqueCubeLookup = new boolean[4096];
但是我發現BitSet在管理內存方面要好得多,所以我將其更改為:
public static final BitSet opaqueCubeLookup = new BitSet(4096);
我也有這段代碼:
opaqueCubeLookup[par1] = this.isOpaqueCube();
但是在移動到BitSet之后,我遇到了問題,我得到了這個錯誤:
The type of the expression must be an array type but it resolved to BitSet
我該如何解決? 任何幫助表示贊賞!
opaqueCudeLookup.set(par1, this.isOpaqueCube());
采用:
opaqueCubeLookup.set(part1, this.isOpaqueCube());
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.