[英]In Java, how do I take the values of a 2D array and store them in another 2D array with different column and row size?
[英]In Java, how do I retrieve the data values from the xml and store them in an array?
這是我的 xml 文件
<waveform>
<Ivalue>12,13,14,15,16,17,18</Ivalue>
<IIvalue>1,4,15,23,22,44</IIvalue>
</waveform>
<waveform>
<Ivalue>12,13,14,15,16,17,18</Ivalue>
<IIvalue>1,4,15,23,22,44</IIvalue>
</waveform>
在這里,我知道如何通過標簽檢索值,但是否可以將這些值存儲到單獨的int[]
中? 謝謝
您可以使用JAXB提取標簽,例如 Ivalue AS STRING。
據我所知,至少不容易直接將其作為 int 數組獲取(使用 JAXB)
但是,使用String.split拆分字符串並使用Integer.parse轉換結果很容易
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.