Author:
Daisy Williams
Nov
16
import java.util.EnumSet;
public final class EnumMeg
{
public static void main(String[] args)
{
Integer i = null;
method(i);
}
static void method(int k){
System.out.println(k);
}
}
It will compile but will throw a NullPointerException at runtime.
Permanent link to this post (37 words, estimated 9 secs reading time)
Author:
Daisy Williams
Oct
24
The java.util.EnumSet set is a special purpose set. It is used to provide an implementation for better performance for enum types. It is necessray that the elements in an enum set must come from a single enum type that is specified, explicitly or implicitly, when the set is created. They are represented internally as bit vectors. This representation is extremely compact and efficient.
Filed under:
Uncategorized