I want to convert a String
myString like that:
[ ["cd",5,6,7], ["rtt",55,33,12], ["by65",87,87,12] ]
into an ArrayList<CustomClass>
Where CustomClass
have constructor :
public CustomClass (String name, int num1, int num2, int num3)
I tried first to create ArrayList
of Strings
:
List<String> List = new ArrayList<String>(Arrays.asList(myString.split("[")));
Didn't worked for me...
How can I get something like that:
List - {CustomClass,CustomClass,CustomClass,CustomClass}
first CustomClass = CustomClass.name="cd" , CustomClass.num1=5,CustomClass.num2=7...
second CustomClass = CustomClass.name="rtt",CustomClass.num1=55,CustomClass.num2=55...
and so on...
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…