码迷,mamicode.com
首页 > 其他好文 > 详细

All about Built-inTypes

时间:2017-02-11 14:32:26      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:data   types.h   比较   long   类型   style   ide   acl   line   

1,Every identifier in a Java program has a type associated with it.

当你使用任何variable的时候,第一件事情是告诉你可爱的编译器它到底是是个什么类型!!!

 

2,AP Java 考到的类型包括 (primitive type)

int           An integer. For example 3, 0, -34

double     A double precision floating-point number. For example 0.456, -456.553

boolean   A boolean. Just two values, true or false(注意大小写,‘t‘ 和 ‘f‘ 都是小写)

一些不考的类型 (primitive type)

byte,short,long,float,char

如果想看更加详细的官方定义 请点击

 

3,int数据最大能表示的整数位231-1,最小的整数位-231

 

4,double并不能表示所有小数,具体的小数表示方式请点击我们要记住的一句话是官方文档中的描述

    this data type should never be used for precise values, such as currency

    这也就就涉及到一个非常重要的考点:double类型数据不能用 “==” 来比较大小

All about Built-inTypes

标签:data   types.h   比较   long   类型   style   ide   acl   line   

原文地址:http://www.cnblogs.com/dapanshe/p/6389082.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!