zoukankan      html  css  js  c++  java
  • Data Types in Java

    In Java, Data types are classified into two categories:

    1. Primitive Data Type

    2. Non-Primitive Data Type

    there are 8 primitive data types:

    char  boolean  byte  short  int   long   float  double

    8 primitive can be classfiied into 4 groups;

    group 1: Integer

    byte : It is 8 bit integer data type. Value range from -128 to 127. Default value zero. example: byte b=10;

    short : It is 16 bit integer data type. Value range from -32768 to 32767. Default value zero. example: short s=11;

    int : It is 32 bit integer data type. Value range from -2147483648 to 2147483647. Default value zero. example: int i=10;

    long : It is 64 bit integer data type. Value range from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. Default value zero. example: long l=100012;

    group 2: Floating-Point Number

    float : It is 32 bit float data type. Default value 0.0f. example: float ff=10.3f;

    double : It is 64 bit float data type. Default value 0.0d. example: double db=11.123;

    group 3: characters

    char : It is 16 bit unsigned unicode character. Range 0 to 65,535. example: char c='a';

    group 4: boolean

    This group represent boolean, which is a special type for representing true/false values. They are defined constant of the language. example: boolean b=true;

    2) Non-Primitive (Reference) Data Type:

    A reference data type is used to refer to an object. A reference variable is declare to be of specific and that type can never be change. We will talk a lot more about reference data type later in Classes and Object lesson.

  • 相关阅读:
    (转)ubuntu 对拍和基本操作
    一个在线翻译LateX的网站
    51nod 1376: 最长递增子序列的数量(二维偏序+cdq分治)
    BZOJ1087: [SCOI2005]互不侵犯King(状态压缩动态规划)
    ZOJ Problem Set
    bzoj2301:[HAOI2011]Problem b(容斥+莫比乌斯反演+分块)
    BZOJ 4318 OSU!期望DP
    CodeForces 235B Let's Play Osu!(概率)
    博客界面美化
    A+B Problem
  • 原文地址:https://www.cnblogs.com/morningdew/p/5618472.html
Copyright © 2011-2022 走看看