网页学习体会

  • 首页
  • 个人博客
您的位置: 首页  >  技术问答  >  Type mismatch: cannot convert from int to Object问题

Type mismatch: cannot convert from int to Object问题

分类: 技术问答 • 2022-03-11 22:44:21
问题描述:

        int thistime = 0;
        thistime = getRate(str1,thiskey);
        ob1[1][1] = thistime;//将此数字存入数组
        //上述行报错,如标题所示


    object类作为父类,为什么不能接收此数字?

答

java语言不允许值类型存入Object,可以使用int的外覆类Integer
ob1[1][1] = new Integer(thistime);

相关推荐

  • Type mismatch: cannot convert from ComboPooledDataSource to DataSource
  • 技术难题:Type mismatch: cannot convert from String to int,该怎么处理
  • vc++.net中的有关问题( error C2440: 'type cast' : cannot convert from 'CString' to 'const char *')
  • Type mismatch: cannot convert from Enumeration to Enumeration
  • Cannot cast from Object to int 是什么有关问题
  • Type mismatch: cannot convert from MainFragment to Fragment 出错
  • Type mismatch: cannot convert from Enumeration<String> to Enumeration<Object>
  • 关于“error C2440: '=' : cannot convert from 'int' to 'struct HWND_ *'有关问题”
  • Type mismatch: cannot convert from java.sql.PreparedStatement to com.mysql.jdbc.PreparedStatement
  • Type mismatch: cannot convert from Object to Book
  • double与float的区别....
  • 【Java问题】double grade= input.nextInt();这条语句!!
    网站免责声明 网站地图 最新文章 用户隐私 版权申明
本站所有数据收集于网络,如果侵犯到您的权益,请联系网站进行下架处理。   

Copyright © 2018-2021   Powered By 网页学习体会    备案号:   粤ICP备20002247号