在java中以char或string变量存储可序列化的数据

zfciruhq  于 2021-07-13  发布在  Java
关注(0)|答案(1)|浏览(303)
Serializable a = randomForest.getClassificationByMaxProb(attributes);  
System.out.println("Assigned class: " + a);

我得到的结果是:

Assigned class: 1

我想存储 1 任何 char 或者 int 变量。

5tmbdcev

5tmbdcev1#

如果a包含1,这意味着tostring()方法返回1,则可以执行以下操作
int iserizable=integer.parseint(a.tostring());

相关问题