zoukankan      html  css  js  c++  java
  • 数据类型

    Java语言是强类型语言,对于每一种数据都定义了明确的具体数据类型,在内存总分配了不同大小的内存空间

    基本数据类型:1.数值型 包括(整数类型:byte,short,int,long)和(浮点类型:float,double

    2.字符型(char)3.布尔型(boolean

    引用数据类型:1.类(class)2.接口(interface)3.数组([ ]

    数据类型:

    +是一个运算符,,做数据的加法。

    boolean类型不能转换为其他的数据类型

    默认转换

    byte,short,charintlongfloatdouble

    byte,short,char相互之间补转换,他们参与运算首先转换为int类型

    强制转换

    目标类型 变量名=(目标类型)(被转换的数据);

    如: byte a=byte128//此结果为-128,溢出。

  • 相关阅读:
    405
    406
    4-1
    3-11
    3-10
    3-9
    3-8
    3-7
    3-5
    3-4
  • 原文地址:https://www.cnblogs.com/ysg520/p/9326683.html
Copyright © 2011-2022 走看看