java怎么定义一个字符串数组

如题所述

下面2种写法都可以;

String [] array = new String[]{"1","b"};
String  array[] = new String[]{"1","b"};

温馨提示:答案为网友推荐,仅供参考
第1个回答  2017-03-24
String[] str1 = {"this is A","this is B","this is C"};
String str2[] = {"this is A","this is B","this is C"};
String[] str3 = new String[3];

相似回答