Byte [] B = {1, 2, 20,108 };
String stmp = java. Lang. Integer. tohexstring (B [N] & 0xff)
In 32-bit computers, numbers are stored in 32 format. If a byte (8-bit) number is used, its 24-bit height is a random number, which is 8-bit lower.
Is
Java.langClass IntegerJava.lang.ObjectJava.lang.NumberJava.lang.Integerall implemented interfaces:Serializable, comparable
Public final class IntegerExtends numberImplements ComparableThe Integer class wraps the value of a primitive type int
Int type package Integer, int type integer
1. Integer Overview
Requirement 1: Calculate the binary, octal, and hexadecimal values of the 100 data.Requirement 2: Determine whether a data is within the int range.First, you need to know the int
Integer source code to binary to hexadecimal, integer source code
There is a private method, where toUnsignedString (int I, int shift) isPublic static String toHexString (int I ){Return toUnsignedString (I, 4 );}Public static String toBinaryString (
There are eight basic data types in http://qxzxcjq-126-com.iteye.com/blog/883283 java: int, char, Boolean, Byte, long, double, float, short. Java is an object-oriented programming language, and data is an object in Java. The object we created with
The integer of the Java species is the wrapper type of int1. Integer is the wrapper type of int, the data type is class and the initial value is null2. When initializing int i = 1new Integer (1);3. Automatic packing and unpacking of class1)
Package com. zdz8207.test;
/*** Convert a Chinese character string to a hex byte array. One Chinese character is saved in two bytes, and a large integer is saved in two bytes.* @ Author zhengdunzhuang**/Public class
Print the specified byte array in hexadecimal format to the console public static string tohexstring (int I) and return the string representation of an integer parameter in hexadecimal notation.
If the parameter is negative, the unsigned integer is
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.