Literals
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的更多相关文章
- Python Set Literals
现有3种方式创建set() >>> def f(): ... return set([1, 2, 3]) ... >>> def h(): ... return s ...
- java Literals
Primitive Data Types The Java programming language is statically-typed, which means that all variabl ...
- thymeleaf中的Literals
Literals即为文字 一.Text literals:文本文字 文本文字只是字符串指定的单引号之间.他们可以包含任何字符,但你应避免任何单引号里面\ ' <p> Now you are ...
- A Tour of Go Map literals
Map literals are like struct literals, but the keys are required. package main import "fmt" ...
- 解决author波浪线Spellchecker inspection helps locate typos and misspelling in your code, comments and literals, and fix them in one click
自从把默认的头注释的author改成自己的名字以后越看越顺眼,但是发现名字下面一直有个波浪线,强迫症简直不能忍. 然后当你把鼠标放上去,再点击提示上的"more",会看到下面的提示 ...
- 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 ...
- Template literals
[Template literals] Template literals are string literals allowing embedded expressions. You can use ...
- C++11中的raw string literals
作为一名C++书看得少得可怜的新手,我一直没有勇气去系统地学习一下C++ 11添加的新特性.不过,平日里逛论坛,阅读大犇们的博客,倒是了解了一些.比如,这个帖子: 如何绕过g++ 4.8.1那个不能在 ...
- 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 ...
- xcode中一些便捷用法@literals简写
总结一下,新的属性绑定规则如下: ● 除非开发者在实现文件中提供getter或setter,否则将自动生成 ● 除非开发者同时提供getter和setter,否则将自动生成实例变量 ● 只要写了s ...
随机推荐
- Robot Framework基础学习(五)
Selenium2Library 常用关键字介绍 关于Selenium2Library 的关键字,我们可以参考:http://rtomac.github.io/robotframework-selen ...
- function multi-versioning in GCC
https://lwn.net/Articles/691932/ https://gcc.gnu.org/wiki/FunctionMultiVersioning why multi-versioni ...
- 《精通Spring4.X企业应用开发实战》读后感第四章
- 5、scala面向对象-类
一.类 1.定义类 ##定义并调用 scala> :paste // Entering paste mode (ctrl-D to finish) class HelloWord { priva ...
- Spring入门第二十一课
切面优先级 先看代码: package logan.study.aop.impl; public interface ArithmeticCalculator { int add(int i, int ...
- HDU - 4284 Travel(floyd+状压dp)
Travel PP loves travel. Her dream is to travel around country A which consists of N cities and M roa ...
- codeforces 547B【单调栈】
题意: 有一个长度为n的序列,序列有长度为1...n的连续子序列, 一个连续子序列里面最小的值称作这个子序列的子序列的strength, 要求出每种长度的连续子序列的最大的strength. 思路: ...
- IT兄弟连 Java语法教程 Java语言的其他特性
Java语言中除了非常重要的跨平台特性外,还有如下几个关键特性: ● 语法简单易学 Java语言的语法简单明了,容易掌握,而且是纯面向对象(OOP)的语言,Java语言的简单性主要体现在以下几个方面 ...
- python 之 函数 面向过程 三元表达式 函数递归
5.11 面向过程编程思想 核心是'过程'二字,过程即解决问题的步骤,即先干什么,再干什么........ 基于面向过程编写程序就好比在设计一条流水线,是一种机械式的思维方式. 总结优缺点: 优点:复 ...
- UML工具 PlantUML SequenceDiagram