Uppercase or lowercase L means long (however, using a lowercase l is confusing because it can look like the number one)

long l = 200L;

Uppercase or lowercase F means float.

float f = 200F;

Uppercase or lowercase D means double.

double d = 200D;

Hexadecimal (base 16), which works with all the integral data types, is denoted by a leading 0x or 0X followed by 0-9 or a-f either in uppercase or lowercase.

Notice in the preceding code the maximum possible hexadecimal values for char, byte, and short.

char c = 0Xffff;
byte b = 0X7f;
short s = 0X7fff;

Octal (base 8) is denoted by a leading zeroin the number and digits from 0-7.

int i = 0200;

This is easily accomplished with the static toBinaryString( ) methods from the Integer and Long classes.

Notice that when passing smaller types to Integer.toBinaryString( ), the type is automatically converted to an int.

Literals的更多相关文章

  1. Python Set Literals

    现有3种方式创建set() >>> def f(): ... return set([1, 2, 3]) ... >>> def h(): ... return s ...

  2. java Literals

    Primitive Data Types The Java programming language is statically-typed, which means that all variabl ...

  3. thymeleaf中的Literals

    Literals即为文字 一.Text literals:文本文字 文本文字只是字符串指定的单引号之间.他们可以包含任何字符,但你应避免任何单引号里面\ ' <p> Now you are ...

  4. A Tour of Go Map literals

    Map literals are like struct literals, but the keys are required. package main import "fmt" ...

  5. 解决author波浪线Spellchecker inspection helps locate typos and misspelling in your code, comments and literals, and fix them in one click

    自从把默认的头注释的author改成自己的名字以后越看越顺眼,但是发现名字下面一直有个波浪线,强迫症简直不能忍. 然后当你把鼠标放上去,再点击提示上的"more",会看到下面的提示 ...

  6. How to distinguish between strings in heap or literals?

    Question: I have a use case where I can get pointers of strings allocated either in memory or litera ...

  7. Template literals

    [Template literals] Template literals are string literals allowing embedded expressions. You can use ...

  8. C++11中的raw string literals

    作为一名C++书看得少得可怜的新手,我一直没有勇气去系统地学习一下C++ 11添加的新特性.不过,平日里逛论坛,阅读大犇们的博客,倒是了解了一些.比如,这个帖子: 如何绕过g++ 4.8.1那个不能在 ...

  9. react 使用 ref 报错 ,[eslint] Using string literals in ref attributes is deprecated. (react/no-string-refs)

    react 项目中给指定元素加事件,使用到 react 的 ref 属性,Eslink 报错 [eslint] Using string literals in ref attributes is d ...

  10. xcode中一些便捷用法@literals简写

    总结一下,新的属性绑定规则如下: ●  除非开发者在实现文件中提供getter或setter,否则将自动生成 ● 除非开发者同时提供getter和setter,否则将自动生成实例变量 ●  只要写了s ...

随机推荐

  1. SpringMVC前置控制器SimpleUrlHandlerMapping配置

    1. <?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5&qu ...

  2. select2的远程加载非分页实例

    $("#c01-select").select2({ ajax: { url: "data.json", dataType: 'json', delay: 25 ...

  3. appium+Java+testng自动化框架搭建-第一季

    app自动化越来越火,随着移动app的不断发展,手机端测试日益火爆,想成为一个高级软件测试工程师必须要掌握,那么我们今天就来搭建appium+Java+testng自动化测试框架. Appium环境搭 ...

  4. js读取excel中日期格式转换问题

    在使用js-xlsx插件来读取excel时,会将2018/10/16这种数据自动装换成48264.12584511. 所以需要自己手动再转换回来 // excel读取2018/01/01这种时间格式是 ...

  5. [51nod] 1267 4个数和为0 暴力+二分

    给出N个整数,你来判断一下是否能够选出4个数,他们的和为0,可以则输出"Yes",否则输出"No". Input 第1行,1个数N,N为数组的长度(4 < ...

  6. unite2017《Unity企业级支持案例与分析》

    在今天举办的Unite2017开发者大会上,Unity大中华区技术支持总监张黎明以"Unity企业级支持案例与分析"为主题进行了分享. 以下为演讲实录: 张黎明:非常感谢大家来参加 ...

  7. MySQL 之 LOAD DATA INFILE 快速导入数据

    SELECT INTO OUTFILE > help select; Name: 'SELECT' Description: Syntax: SELECT [ALL | DISTINCT | D ...

  8. jmeter后置处理器之正则表达式

    一.基本用法——提取某个值 场景:提取某个值,保存成变量,供后面的接口使用 步骤: 1.运行脚本,从响应结果中查找要提取的值,找到左右边界. 例如要获取“patientInfoId”作为下一个请求的参 ...

  9. Spring包的依赖关系以及提供下载

    https://www.jianshu.com/p/5b0c96975164 这篇简书叙述的很完整 一下是个人整和的炸包,里面有很全面的Spring包, 还有一些其他包,都是官网下载 emmmm... ...

  10. 8.Python初窥门径(文件操作)

    Python (文件操作) 一.文件操作方式 打开文件 open 操作文件 read or write 关闭文件 close 二.打开文件的方式(第一种) 语法 : f=open("文件&q ...