Home > Back-end > Arraylist array encounter problems, learn from each elder??
Arraylist array encounter problems, learn from each elder??
Time:12-10
Written in a class, give a Arraylist array assignment, now judge enter 1 time to modify the subscript 2 elements, but can not change, the set error is how to return a responsibility?
CodePudding user response:
ArrayList type is a test, the set of "dsaf" is a String type,
public String STR;
.
The test m1=new test (); M1. STR="dsaf"; L.s et (2, m1);
CodePudding user response:
You directly to collection set a String must not ah, want to take the test first, and then to the second attribute assignment,