首页 > 其他 > 详细

All about Built-inTypes

时间:2017-02-11 14:31:55      阅读:212      评论:0      收藏:0      [点我收藏+]

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

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!