次のコードがあります。
public void parseAttribs(String attribs){
//attribs is a comma separated list
//we are making a List from attribs by splitting the string at the commas
List<String> attributes = Arrays.asList(attribs.split("\\s*,\\s*"));
//when I try to add an element to the attributes List if fails
attributes.add("an element");
このUnable to add a String to an ArrayList: "misplaced construct(s)"が見つかり、サブクラスを作成しようとしましたが、リストをサブクラスにも渡す必要がありましたが、それでも機能しませんでした。
誰でもこれに光を当てることができますか?
どうもありがとう