All about Built-inTypes

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类型数据不能用 “==” 来比较大小

时间: 2024-10-05 13:47:31

All about Built-inTypes的相关文章

eclipse工程总是提示红叉,但是没有看到哪出错了!The project was not built due to "Could not delete

最近在编译web project的时候,页面总是提示xx方法没有被定义为xx类.但是明明都是正确的. 而且在工程上有个红叉但是程序并没有看到哪有错误.如下图: 解决方法: 1.先打开problem窗口,才能看到意想不到的错误. Window-show view-other-找到problem.然后就会看到一条错误.如下: The project was not built due to "Could not delete '/build/com'.". Fix the problem,

如何解决…has been modified since the precompiled header… was built的问题

如何解决-has been modified since the precompiled header- was built 的问题 xcode5.1在程序中报错: File '/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator7.1.sdk/System/Library/Frameworks/UIKit.framework/Hea

Part3 – OPENVSWICH – Campus Model with Layer2 Access built with Open-Source Applications

In part one we showed how to create Openvswitch extension and submit it to Microcore repository. There were also presented after-install steps for Openvswitch adapted for specific Core needs. http://brezular.com/2011/09/03/part1-openvswich-creating-a

提交时提示错误This Bundle is invalid.New apps and app updates submitted to the App Store must be built wit

今天传appstore的时候发生了一个问题. this bundle is invalid . new apps and app updates submitted to the app store must be built with public 在网上查了好久,始终告诉我,要使用xcode5,和IOS7但是奇怪的是我本来使用的就是xcode5.1和ios7打的包,最后试了很多次,发现大概从5月12日开始,必须使用最新的xcode5.1.1才能上传应用,最后终于解决问题. 提交时提示错误Th

exactly the kind of division of tasks that Gulp.js is built on

The results are then passed to a reporter function that displays the results of the code analysis in the command window—exactly the kind of division of tasks that Gulp.js is built on and that makes it so easy to configure. ---------- 译为:正是这种Gulp.js构建

iOS 协同开发出fatal error: file ‘XX-Prefix.pch’ has been modified since the precompiled header was built

在协同开发的时候,刚刚从svn下载到本地的代码,出现“fatal error: file 'XX-Prefix.pch' has been modified since the precompiled header was built”的问题,这个其实不是什么问题,解决方案如下: 1.找到  XX-Prefix.pch 文件  注释掉下面的代码: #ifdef __OBJC__ #import <UIKit/UIKit.h> #import <CoreData/CoreData.h>

the project was not built since its build……

[问题描述] 用eclipse编译程序时,出现下面错误: The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object The type java.lang.Object cannot be resolved…… [解决方案] 将该项目从eclipse删除,并删除gen.bin.libs.obj下生成的文件,重新导入eclipse

导入项目出现错误:the project cannot be built until build path errors are resolved

导入项目到eclipse时,可能会出现the project cannot be built until build path errors are resolved的错误. 作者在写这个项目时,在build path中添加了他的机器里面lib目录下的一些包,这些被工程记录下来了.当你导入这个项目的时候, 会自动到你的电脑下找原来那个lib下的jar包,你没有这个路径,就导致出现了这个问题. 解决办法:右键工程,选择build path->configure build path.弹出的窗口里选

The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object

The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object (2007-08-29 10:13:56) 转载▼ 错误提示:The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object

Android -- the project was not built due to a resource exists with a different case...

进行编码时,工程前面莫名有个红X,正当百思不得其解时,发现在[problems]下有如下的消息输出 ------ the project was not built due to a resource exists with a different case... ------ 按照提示对代码再次进行了check,果然是大小写出了问题,具体如下: 包名为:com.example.Android_intent3 但很奇怪的是.java文件中AndroidMaifest.xml中引用该包的地方都变成