What does EnumSet really mean?

后端 未结 10 1523
小蘑菇
小蘑菇 2020-12-04 16:08

I have the following example:

import java.util.EnumSet;
import java.util.Iterator;

public class SizeSet {

    public static void main(String[] args) {
             


        
10条回答
  •  天涯浪人
    2020-12-04 16:57

    According to Oracle doc

    Enum sets are represented internally as bit vectors. This representation is extremely compact and efficient.

    Readable, type safe, low memory footprint... What do you want more?

提交回复
热议问题