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 ...
随机推荐
- android apk 防止反编译技术第二篇-运行时修改字节码
上一篇我们讲了apk防止反编译技术中的加壳技术,如果有不明白的可以查看我的上一篇博客http://my.oschina.net/u/2323218/blog/393372.接下来我们将介绍另一种防止a ...
- unique()函数
unique()是c++里面的一个去重函数,包含在<iostream>中. 该函数将重复的元素移至容器的末尾,返回的为前面的无重复项的尾地址. 由于返回的是地址,所以经常需要转换为数值使用 ...
- 「一入 Java 深似海 」系列课程
第一期 「一入 Java 深似海 」系列课程 - 第一期 第一节:Java 语言基础
- Spring入门第七课
Bean之间的关系:继承和依赖. 继承Bean配置 Spring允许继承bean的配置,被继承的bean称为父bean,继承这个父bean的Bean称为子Bean. 子Bean从父Bean中继承配置, ...
- Javascript实现页面左边的菜单选中项高亮显示
在项目开发过程中,遇到一个问题 在一个模板页面中,Layout.cshtml,页面左边放了一个菜单项menu,每一项都是一个链接到一个新的页面.但所有页面都是用这个模板Layout.cshtml.需要 ...
- HRBUST - 1819 石子合并问题--圆形版(区间dp+环形+四边形优化)
石子合并问题--圆形版 在圆形操场上摆放着一行共n堆的石子.现要将石子有序地合并成一堆.规定每次只能选相邻的两堆合并成新的一堆,并将新的一堆石子数记为该次合并的得分.请编辑计算出将n堆石子合并成一堆的 ...
- Ubuntu 16 Mysql 安装配置
安装Mysql apt-get update; apt-get install mysql-server apt-get install mysql-client //安装过程中会提示修改密码 ...
- ssm重新开发计科院新闻网站
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"% ...
- How to use unity CreateExternalTexture on Android?
http://stackoverflow.com/questions/33324753/how-to-use-unity-createexternaltexture-on-android Can so ...
- 51nod1127(尺取法)
题目链接:https://www.51nod.com/onlineJudge/questionCode.html#!problemId=1127 题意:中文题诶- 思路:尺取法 维护一个队列,若当前队 ...