if判断条件过多,利用Map,让代码表达更清晰
作者:互联网
int a = 1;
if(a ==1 || a == 3 || a == 4 || a == 8 || a == 11){
}
=====================================
Map<Integer,Boolean> map = new HashMap();
map.put( 1, true);
map.put( 3, true);
map.put( 4, true);
map.put( 8, true);
map.put( 11, true);
int a = 1;
if(map.get( a )){
}
标签:11,Map,map,int,代码,过多,put,true 来源: https://www.cnblogs.com/0101m/p/15823262.html