java conversion_java 基本数据类型之间的转换(Conversion between Java basic data types).doc...

java 基本数据类型之间的转换(Conversion between Java basic data types)

java 基本数据类型之间的转换(Conversion between Java basic data types)

Java conversion between basic data types - columns of fishinhouse - CSDNBlog fishinhouse's column

The hardest thing to do is to begin, and most importantly, to persist. If you persist, you will achieve your aim!

Login, register, total station, current blog space, blog buddy, album, message, WL, ID:fishinhouse

Java conversion between basic data types

A new common log4j configuration | old a 30 piece of advice: Java code

We know that the Java data types are divided into three categories, namely boolean type, character type and value type, which is divided into numerical integral and floating-point types; compared with the data type Java is a boolean variable type character type Boolean; char; byte, short, int, integer long; floating point float double. The four integer variables and the two floating point variables correspond to different precision and range respectively. In addition, we often use two kinds of variables, namely String and Date. For these variables, conversions between types are often used in programming, and in the following discussion, we will explain how to implement these transformations.

1 types of data type conversions

Java data type conversion generally divided into three kinds, namely:

(1) conversion between simple data types

(2) conversion of strings to other data types

(3) other practical data type conversions

Next, we discuss these three types of transformations.

2 conversion between simple data types

In Java, integer, real, and character types are treated as simple data types, which are from lower to higher (byte, short, char) --int--long--float--double

Conversions between simple data types can be divided into:

Low level to advanced automatic type conversion

? advanced to low-level forced type conversions

Packing type transition type can be converted

2.1 automatic type conversion

Low level variables can be directly converted into advanced variables, which the author calls automatic

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值