我的班級在下面,我如何投ArrayList<TestA>
到String[]
只有ItemText
值沒有任何for循環。哪種方法最好?Java自定義列表到字符串數組
public class TestA implements Serializable {
private String ItemSrc;
private String ItemText;
public String getItemText() {
return this.ItemText;
}
}
爲什麼沒有for循環?什麼是一個while循環?使用java8?流?爲什麼它必須是演員? –
你不能。你必須迭代所有的元素,並且只把「ItemText」放到你新創建的數組中。 – f1sh
列表類是通用的,必須首先加載。對於其他控件,只能使用此類中的一個屬性值。所以我必須演員上課。 –