我如何在其中包含"10"的索引
"10"
private static String[] faces = { "A", "2", "3", "4", "5", "6", "7", "8", "9", "10", "J", "Q", "K" };
使用更少的Java代码?
将String[]包裹在List中,然后使用indexOf:
String[]
List
indexOf
int indexOf10 = Arrays.asList(faces).indexOf("10");