1. 程式人生 > >關於static靜態塊的使用和static list的使用

關於static靜態塊的使用和static list的使用

stat mod all nal cti efault def string 靜態

public class CorsConfiguration {

/**
* Wildcard representing <em>all</em> origins, methods, or headers.
*/
public static final String ALL = "*";

private static final List<HttpMethod> DEFAULT_METHODS;

static {
List<HttpMethod> rawMethods = new ArrayList<HttpMethod>(2);

rawMethods.add(HttpMethod.GET);
rawMethods.add(HttpMethod.HEAD);
DEFAULT_METHODS = Collections.unmodifiableList(rawMethods);
}

關於static靜態塊的使用和static list的使用