【自动化__持续集成】___java___数据类型转换
一、代码如下
package com.wujianbo; public class Demo04 { public static void main(String[] args) { // TODO Auto-generated method stub short si1= 100; int score=530001; System.out.println((short)score); int gdp1= 2147483647; long gdp2= 2147483648L; long l1= 345L; long l2= 1000; System.out.println(l1+l2); } }
二、代码如下
package com.wujianbo; public class Demo05 { public static void main(String[] args) { // TODO Auto-generated method stub System.out.println(-1); System.out.println((int)-1); System.out.println((char)-1); System.out.println((byte)-1); } }
三、代码如下
package com.wujianbo; public class Demo05 { public static void main(String[] args) { // TODO Auto-generated method stub long micro=24*24*60*1000*1000; long millis= 24*24*60*1000; System.out.println(micro/millis); } }