日期:2014-05-20 浏览次数:20932 次
byte[] byteArray = new byte[n];
char[] charArray = new char[n];
...
String[] stringArray = new String[n];
Object[] objectArray = new Object[n];
或
byte[] byteArray = new byte[]{1,2,3,4...};
char[] charArray = new char[]{'1','a','$'...};
...
String[] stringArray = new String[]{"str1","str2","str3"};
Object[] objectArray = new Object[]{new String("str"),new Date(),...};
------解决方案--------------------
System.out.println((new String[0]).getClass());
System.out.println((new byte[0]).getClass());
System.out.println((new char[0]).getClass());
char[] charArray = {'1','a','$'};
String[] stringArray = {"str1","str2","str3"};
Object[] objectArray = {new String("str"),new java.util.Date()};