Arrays.asList 列表使用

Arrays.asList 列表使用

public final static String [] CAR_TYPE={"30","35"};
List carLists = Arrays.asList(CAR_TYPE)

String carType = "20";

if(carLists.contain(carType)){

 System.out.println("exists")

}else{

 System.out.println("not exists")

}

 

posted on 2024-09-07 15:02  oktokeep  阅读(5)  评论(0编辑  收藏  举报