Java中,字符串数组的定义方式有以下几种:
String[] arr = {"str1", "str2", "str3"};
String[] arr = new String[3];
arr[0] = "str1";
arr[1] = "str2";
arr[2] = "str3";
List<String> list = Arrays.asList("str1", "str2", "str3");
String[] arr = list.toArray(new String[list.size()]);
String str = "str1,str2,str3";
String[] arr = str.split(",");