当前位置:网站首页>Why does next() in iterator need to be forcibly converted?
Why does next() in iterator need to be forcibly converted?
2022-06-28 20:10:00 【Yuyy】
This paper is finally updated at 914 Days ago, , The information may have developed or changed .
List<MyFile> myFileList=new LinkedList<>();
Iterator iterator=myFileList.iterator();
while (iterator.hasNext()){
MyFile myFile=(MyFile) iterator.next();
}- Because iterators do not define generics ,next() Default will return Object, So we need a strong turn .
- Add generics OK,Iterator< MyFile> it = myFileList.iterator();
Post Views: 425
边栏推荐
- 严重性 代码 说明 项目 文件 行 禁止显示状态 错误 LNK2038 检测到“RuntimeLibrary”的不匹配项: 值“MD_DynamicRelease”不匹配值“MDd_DynamicDe
- 各种类型长
- Priority problem when local variables and global variables in C language have the same name (when local variables and global variables exist at the same time, local variables are preferred to be refer
- echart:横向柱状图的类目文字位置调整
- 怎么理解云原生数据库的快速迭代?
- 522. longest special sequence II (greedy & double pointer)
- 怎么理解云原生数据库的易用性?
- Grep text search tool
- Average score of 100 people
- rsync远程同步
猜你喜欢
![return new int[]{i + 1, mid + 1};return {i + 1, mid + 1};](/img/6a/45a4494276deba72ef9833818229f5.png)
return new int[]{i + 1, mid + 1};return {i + 1, mid + 1};

On the first anniversary of the data security law, which four major changes are coming?

Rsync remote synchronization

集合之ArrayList
![[algorithm] I brushed two big factory interview questions and learned array again with tears in my eyes“](/img/13/1b49326d5fe79ed1e73a2b52e7c42f.png)
[algorithm] I brushed two big factory interview questions and learned array again with tears in my eyes“

如何获取飞机穿过雷达两端的坐标

echart:横向柱状图的类目文字位置调整

How strong a mathematical foundation does deep learning need?

社招两年半10个公司28轮面试面经

Paper notes: universal value function approvers
随机推荐
Use of WC command
30讲 线性代数 第四讲 线性方程组
2837. The total number of teams
2280.Cupboards
csdn涨薪技术-Selenium自动化测试全栈总结
1002_20181019
R language GLM generalized linear model: logistic regression, Poisson regression fitting mouse clinical trial data (dose and response) examples and self-test questions
请允许当下国内ToB的「不完美」
Server configuration estimation of core IOT Bluetooth AOA positioning system
risc-v指令集
Quaternion quaternion and Euler angle Transformation in Ros
Risc-v instruction set
How to understand the usability of cloud native databases?
圆球等的相关计算
2022 tea master (intermediate) examination simulated 100 questions and simulated examination
return new int[]{i + 1, mid + 1};return {i + 1, mid + 1};
How does redis implement inventory deduction? How to prevent oversold?
Bluecmsv1.6 code audit
Digital collection, ten thousand words long text, most of the questions you want to know have been clearly explained, which must be seen by practitioners
[go language questions] go from 0 to entry 5: comprehensive review of map, conditional sentences and circular sentences