• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
 






cn-iwish

 
 

Powered by 博客园
博客园 | 首页 | 新随笔 | 联系 | 订阅 订阅 | 管理

2023年3月6日

集合没有指明泛型,获取数据需要强转
摘要: List list = new ArrayList(); list.add(2); list.add(1); list.remove(1); // 1 Iterator it = list.iterator(); //2 while(it.hasNext()){ // 3 int number = 阅读全文
posted @ 2023-03-06 19:38 残梦& 阅读(15) 评论(0) 推荐(0)
 
Object类对象的数字能参与四则运算吗
摘要: Object a = 1; System.out.println(a+1); 报错:The operator + is undefined for the argument type(s) Object, int 必须是基本数据类型(数值类型的)才能运算. 阅读全文
posted @ 2023-03-06 19:20 残梦& 阅读(19) 评论(0) 推荐(0)