JZTXT
  • 首页
  • Ai
  • Java
  • Python
  • Android
  • Mysql
  • JavaScript
  • Html
  • CSS

LickedList中由Object 类转换为int整形

发布时间 2023-03-25 22:03:33作者: 落"

LickedList中由Object 类转换为int整形


遇到的一道题,我使用LickedList来对数据进行增加和删除操作,其中遇到需要将list数据转换为int整形数据的操作。

 

首先把Object对象转换为String类型,再调用Inerger中的parseInt()转换为int类型

Object firstElement = list.getFirst();
int temp = Integer.parseInt(String.valueOf(firstElement));
 
    本栏目推荐文章
  • Center-based 3D Object Detection and Tracking
  • c++编译OpenSceneGraph-3.4 出现 error: narrowing conversion of ‘-1’ from ‘int’ to ‘char’ inside { } [-Wnarrowing]
  • C语言中这几种数组,弄明白了吗?int(*pai[2])[5],int *aapi[2][2], int **p[2], int *numT[5], int(*num2)[5]
  • Learning Dynamic Query Combinations for Transformer-based Object** Detection and Segmentation论文阅读笔记
  • OOP语义学 第一章 关于对象(Object Lessons)
  • C语言int * (* (*fp1) (int) ) [10]声明是啥意思呢?
  • C/C++函数参数声明解析:int fun() 与 int fun(void) 的差异揭秘
  • QT6.4.3中,关于QString asprintf(const char*cformat,...)与int asprintf(char**strp,const char*fmt,...)的使用问题
  • error: object StdIn is not a member of package io问题的解决
  • the ObjectARX system dynamic linker object
版权声明:本网站为非赢利性站点,本网站所有内容均来源于互联网相关站点自动搜索采集信息,相关链接已经注明来源。
联系我们