[五]基础数据类型之Short详解

| 值为 215-1 的常量,它表示 short 类型能够表示的最大值 public static final short MAX_VALUE = 32767; |
| 值为 -215 的常量,它表示 short 类型能够表示的最小值 public static final short MIN_VALUE = -32768; |
| 用来以二进制补码形式表示 short 值的比特位数 public static final int SIZE = 16; |
| 二进制补码形式表示 short 值的字节数 public static final int BYTES = SIZE / Byte.SIZE; |
| 表示基本类型 short 的 Class 实例 public static final Class<Short> TYPE = (Class<Short>) Class.getPrimitiveClass("short"); |
Short(short value)![]() |
Short(String s)
|
|
static int compare(short x, short y)
静态方法
x<y 小于0
x=y 等于0
x>y 大于0
|
| int compareTo(Short anotherShort) 实例方法 调用静态方法比较两个对象的值
|

static short parseShort(String s, int radix)![]() |
static short parseShort(String s)
|


| static Short valueOf(short s)
|
| static Short valueOf(String s, int radix)
|
| static Short valueOf(String s)
|

| 类似 Integer和Long Byte Short也有提供XXXValue系列方法,原理也跟他们类似 全部都是强转 |
|
byteValue()
shortValue()
intValue()
longValue()
floatValue()
doubleValue()
|
| static String toString(short s)
|
| String toString()
|
| static int toUnsignedInt(short x)
|
| static long toUnsignedLong(short x)
|
| 重写了equals方法 内部比较的是对象的值 |
|
| static int hashCode(short value)
|
| int hashCode()
|
[五]基础数据类型之Short详解的更多相关文章
- [二]基础数据类型之Long详解
Long Long 基本数据类型long 的包装类 Long 类型的对象包含一个 long类型的字段 属性简介 值为 263-1 的常量,它表示 long 类型能够表示的最大值 ...
- [三]基础数据类型之Integer详解
Integer 基本数据类型int 的包装类 Integer 类型的对象包含一个 int 类型的字段 属性简介 值为 2^31-1 的常量,它表示 int 类型能够表示的最大值 @N ...
- [八]基础数据类型之Double详解
Double 基本数据类型double 的包装类 Double 类型的对象包含一个 double 类型的字段 属性简介 用来以二进制补码形式表示 double 值的比特位数 public sta ...
- [七]基础数据类型之Float详解
Float 基本数据类型float 的包装类 Float 类型的对象包含一个 float 类型的字段 属性简介 用来以二进制补码形式表示 float 值的比特位数 public sta ...
- [九]基础数据类型之Boolean详解
相对于其他的基础性 类型Boolean是很简单的 Boolean 基本数据类型boolean 的包装类 Boolean 类型的对象包含一个 boolean 类型的字段 属性简介 属性也比较 ...
- VC++常用数据类型及其操作详解
原文地址:http://blog.csdn.net/ithomer/article/details/5019367 VC++常用数据类型及其操作详解 一.VC常用数据类型列表 二.常用数据类型转化 2 ...
- Python数据类型及其方法详解
Python数据类型及其方法详解 我们在学习编程语言的时候,都会遇到数据类型,这种看着很基础也不显眼的东西,却是很重要,本文介绍了python的数据类型,并就每种数据类型的方法作出了详细的描述,可供知 ...
- mysql基础篇 - SELECT 语句详解
基础篇 - SELECT 语句详解 SELECT语句详解 一.实验简介 SQL 中最常用的 SELECT 语句,用来在表中选取数据,本节实验中将通过一系列的动手操作详细学习 SELEC ...
- Java基础-面向接口编程-JDBC详解
Java基础-面向接口编程-JDBC详解 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.JDBC概念和数据库驱动程序 JDBC(Java Data Base Connectiv ...
随机推荐
- 10-HTTPServletReauest和HTTPServletResponse
Servlet配置方式 1. 全路径匹配 以 / 开始 /a /aa/bb localhost:8080/项目名称/aa/bb 2. 路径匹配 , 前半段匹配 以 / 开始 , 但是以 * 结束 /a ...
- ProgressBar三种style
一.普通的ProgressBar显示如图 <ProgressBar android:id="@+id/pbNormal" android:layo ...
- java 根据某个数字,计算前后多少天的具体日期
import java.text.ParsePosition; import java.text.SimpleDateFormat; import java.util.Calendar; import ...
- 修改 Docker 的 daemon.json后启动失败
创建Harbor要把register 换成Harbor地址 vim /etc/docker/daemon.json添加{ "insecure-registries":[" ...
- Windows下安装Kafka
一.安装JDK 二.安装zooeleeper 下载安装包:http://zookeeper.apache.org/releases.html#download 下载后解压到一个目录: 1.进入Zook ...
- koa2学习(二) 中间件router
中间件 koa-router 安装 npm install --save koa-router 使用 const Koa = require('koa'); const Router = requir ...
- 深入解析Java反射-invoke方法
博客原文:http://www.sczyh30.com/posts/Java/java-reflection-2/ 上篇文章中回顾了一下Java反射相关的基础内容.这一节我们来深入研究Method类中 ...
- [Swift]LeetCode154. 寻找旋转排序数组中的最小值 II | Find Minimum in Rotated Sorted Array II
Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e. ...
- [Swift]LeetCode693. 交替位二进制数 | Binary Number with Alternating Bits
Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will a ...
- [Swift]LeetCode867. 转置矩阵 | Transpose Matrix
Given a matrix A, return the transpose of A. The transpose of a matrix is the matrix flipped over it ...








