//the List array
String [] strArr={" apple ", "pear", "banana", "peach"};
List List=Arrays. AsList (strArr);
//array List
String [] arr=(String []) list. The toArray ();
for(int i=0; i<4. I++) {
System. The out. Print (strArr [I]);
System.out.println();
}
CodePudding user response:
Error error display is 6 lines of code
CodePudding user response:
Should be a String [] arr=list. ToArray (new String [list. The size ()]);
Arr=new String or a String [] [al. The size ()];
List. The toArray (arr);
CodePudding user response:
Code tried, no problem, screenshot error have a look
CodePudding user response: