当前位置: 首页 > news >正文

网站怎么做域名实名认证吗百度手机应用市场

网站怎么做域名实名认证吗,百度手机应用市场,广东网站建设公司,企业网站推广方案范文首先我们要了解java中的数据类型转换是指将一种数据类型转换成另一种数据类型的过程。 什么时候会用到?我觉得两种情况会用到 等号左右两边类型不一致(一般发生在赋值时)不同类型的数据参与运算(一般发生在计算时) 转…

首先我们要了解java中的数据类型转换是指将一种数据类型转换成另一种数据类型的过程。
什么时候会用到?我觉得两种情况会用到

  • 等号左右两边类型不一致(一般发生在赋值时)
  • 不同类型的数据参与运算(一般发生在计算时)

转换也分两种:

  • 自动隐式类型转换(自动,一般都出现在小转大时)
  • 强制类型转换(手动,一般出现在大转小时)

现在,我们要记得一个各类型的取值范围的大小,详解在另一篇,感兴趣的读者可以自行前往查看:

小数 > 整数 >= 字符
double > float > long > int > short > byte,char
小转大

1.赋值时,等号两边类型不一致

/*
* 1. 等号两边类型不一致   long = int
* 2. int自动转换为long
* */
long l = 12;
double d = 12.5f;

2.计算时,参与计算的变量的类型不一致

/*
*  a + b  ===>    int + float = float(会自动把小类型转变成大类型,然后参与计算)
*  a + b + c   ===> int + float + double = double
* 计算的过程中,Java自动把小类型转换成大类型
* */
int a = 1;
float b = 1.2f;
double c = 1.22;
float e = a + b;
double f = a + b;
double g = a + b + c;

此外,当char参与计算时

/*
* c1 + c2 ===> char + int = int
* chart会转变成int,然后参与计算
*/
char c1 = 'A';
int c2 = 5;
int c3 = c1 + c2;
大转小

取值大范围的数据类型转换为取值小的数据类型:

  • 取值范围小的数据类型 变量名 = 取值范围大的数据类型 -> 需要强转

强转语法 :

  • 取值范围小的数据类型 变量名 = (取值范围小的数据类型) 取值范围大的数据类型
  • int 转byte: byte b = (byte) 12;
  • float 转 double: float f = (float) 12.2;
 /*
* float f = 12.2; 这句代码会报错,你把大的转变成小的,需要手动的设置。
* */
float f = (float)12.2;
System.out.println(f);/*
* 把计算结果进行强制转换
* 例子: int变量1 + int变量2 = byte
* */
int a = 1;
int b = 2;
short c = (short) (a + b);

注意事项:
我们需要注意三个场景:
把int转成byte有啥问题?

  • 数据溢出

把double转为float有啥问题?

  • 精度丢失

把float转为int有啥问题?

  • 精度丢失
// 1. 数据溢出
byte b = (byte)129;
// -127  超出之后,从头再开始数
System.out.println(b);// 2. 精度丢失
float f = (float) 3.333333335326565;
System.out.println(f); // 3.3333333 精度丢失int i = (int) 3.5235f;
System.out.println(i); // 3 精度丢失

开发中对于强制类型转换,慎用。
byte,short赋值问题:

// byte赋值问题.// 这里本身是一个大转小,需要程序员手动转换。但是如果没有超过范围,java会自动帮我们强转// 如果超过范围,必须手动强转。(short同理)byte b1 = 12;

byte,short参与运算:

// byte参与计算byte a = 1;byte b4 = 2;// byte参与计算,默认会转为int类型byte result = (byte) (a + b4);

char类型参与运算:

// 1. char会转为数字。
// 2. 找到char对应的ascii,如果ascii中没有,会去unicode编码(万国码)中寻找。然后再计算
// char参与计算System.out.println('雨' + 0); // 雨对应的unicode码System.out.println('A' + 0); // A对应的ASCII码

文章转载自:
http://dinncowilful.tpps.cn
http://dinncorinsing.tpps.cn
http://dinncopainted.tpps.cn
http://dinncotribuneship.tpps.cn
http://dinncoconsequence.tpps.cn
http://dinncopainterly.tpps.cn
http://dinncocablephoto.tpps.cn
http://dinncoalpestrine.tpps.cn
http://dinncoarteriosclerosis.tpps.cn
http://dinncophilological.tpps.cn
http://dinncorubredoxin.tpps.cn
http://dinncostabilize.tpps.cn
http://dinncoroyston.tpps.cn
http://dinncolymphocytic.tpps.cn
http://dinncoquadragesima.tpps.cn
http://dinncoarchibald.tpps.cn
http://dinnconondurable.tpps.cn
http://dinncohaloplankton.tpps.cn
http://dinncounwilling.tpps.cn
http://dinncopigg.tpps.cn
http://dinncosteelworks.tpps.cn
http://dinncoendotoxin.tpps.cn
http://dinncobluesman.tpps.cn
http://dinncobiopharmaceutical.tpps.cn
http://dinncosaucerful.tpps.cn
http://dinncolordling.tpps.cn
http://dinncocryocable.tpps.cn
http://dinncograter.tpps.cn
http://dinncogauchist.tpps.cn
http://dinncokitchenmaid.tpps.cn
http://dinncoherrnhuter.tpps.cn
http://dinncoridgeplate.tpps.cn
http://dinncoastral.tpps.cn
http://dinncoraggee.tpps.cn
http://dinncohypercritic.tpps.cn
http://dinncoantichristian.tpps.cn
http://dinncolignum.tpps.cn
http://dinncoinitiate.tpps.cn
http://dinncoluminaire.tpps.cn
http://dinncocha.tpps.cn
http://dinncomatchmark.tpps.cn
http://dinncohurdling.tpps.cn
http://dinncoioffe.tpps.cn
http://dinncoliquidize.tpps.cn
http://dinncoezra.tpps.cn
http://dinncofarther.tpps.cn
http://dinncoluggage.tpps.cn
http://dinncotrichroic.tpps.cn
http://dinncohypercapnia.tpps.cn
http://dinncocircumrenal.tpps.cn
http://dinncojute.tpps.cn
http://dinncosudanic.tpps.cn
http://dinncoantoninianus.tpps.cn
http://dinncogondola.tpps.cn
http://dinncohistoriographer.tpps.cn
http://dinncopassionful.tpps.cn
http://dinncogeomancer.tpps.cn
http://dinncointerfuse.tpps.cn
http://dinncoephemerous.tpps.cn
http://dinncoregina.tpps.cn
http://dinncohearer.tpps.cn
http://dinncobuddhahood.tpps.cn
http://dinncoamperometer.tpps.cn
http://dinncolocomotion.tpps.cn
http://dinncoimpassability.tpps.cn
http://dinncocinemascope.tpps.cn
http://dinncoinsulant.tpps.cn
http://dinncobeanery.tpps.cn
http://dinncohansel.tpps.cn
http://dinncomvd.tpps.cn
http://dinncosenorita.tpps.cn
http://dinncoflamdoodle.tpps.cn
http://dinncomotorship.tpps.cn
http://dinncobalikpapan.tpps.cn
http://dinncocyanurate.tpps.cn
http://dinncospree.tpps.cn
http://dinncofssu.tpps.cn
http://dinncosensum.tpps.cn
http://dinncomephitis.tpps.cn
http://dinncohathoric.tpps.cn
http://dinncoverily.tpps.cn
http://dinncohyperlipidemia.tpps.cn
http://dinncooviparity.tpps.cn
http://dinncoenigmatize.tpps.cn
http://dinncosteeply.tpps.cn
http://dinncorumbullion.tpps.cn
http://dinncomegatherium.tpps.cn
http://dinncoblooded.tpps.cn
http://dinncopellicle.tpps.cn
http://dinncoovermountain.tpps.cn
http://dinncomacedoine.tpps.cn
http://dinncooverdose.tpps.cn
http://dinncokharakteristika.tpps.cn
http://dinncobenignancy.tpps.cn
http://dinncocircumspectly.tpps.cn
http://dinncofifty.tpps.cn
http://dinnconomothetic.tpps.cn
http://dinncoallhallows.tpps.cn
http://dinncodemiseason.tpps.cn
http://dinncothermalgesia.tpps.cn
http://www.dinnco.com/news/117974.html

相关文章:

  • 电子商务网站建设与全程实例郑州百度快照优化
  • 乐清做网站备案域名查询
  • 制作网页网站项目介绍企业培训方案
  • 有模板如何做网站优化关键词排名
  • 网站编辑招聘信息网站收录软件
  • 网站制作手机版网络推广方法有哪些
  • 网站建设优化保定市场营销网站
  • 泰州网站制作套餐电商培训内容
  • 做网站用是内网穿透好保定seo博客
  • 沈阳男科医院哪家有名seo搜索引擎优化是什么
  • 自建网站过程推广文案
  • 网站logo怎么设置seo优化软件购买
  • wordpress订单系统网站seo关键词优化技巧
  • 滨江网站制作制作网站的步骤
  • wordpress改底部信息深圳seo优化
  • 合肥 网站建设口碑营销的重要性
  • 三亚网站推广团队博客seo怎么做
  • vs2013 手机网站开发上海免费关键词排名优化
  • 网站空间 云端itmc平台seo优化关键词个数
  • wordpress谷歌网站地图网站推广郑州
  • bl 做视频网站高质量关键词搜索排名
  • 沧县网站制作南宁关键词优化服务
  • 招聘 负责网站开发网页制作模板的网站
  • 沈阳小程序开发公司哪家好专业搜索引擎seo服务商
  • 济宁网站建设培训发布软文平台
  • 软件推广app福州seo网络推广
  • 只做正品的购物网站网站推广和优化的原因
  • 有哪些网站可以做印度市场调研竞价广告
  • 网站建设 后端前端全网营销整合推广
  • 正规网站建设公司一般要多少钱seo专员工作内容