int count = 15;
//创建Long对象
Long changeCount =new Long(count);
//因为int和long都是基本类型,能够互相转换
long changCount= new long(count);
错误转换方式
//Long是包装类,而int是值类型数据,两者是不能强转
× Long changeCount =Long(count);
int类型转换成·Long
猜你喜欢
转载自blog.csdn.net/weixin_43889487/article/details/121647583
今日推荐
周排行