This article brings you a detailed analysis of the Java data type Long. It has certain reference value. Friends in need can refer to it. I hope it will be helpful to you.
Long
Long The wrapper class of the basic data type long
Long type The object contains a long type field
Property Introduction
A constant whose value is 263-1, which represents the maximum value that the long type can represent | @Native public static final long MAX_VALUE = 0x7ffffffffffffffffL; |
is a constant with a value of -263, which represents the smallest value that the long type can represent Value | @Native public static final long MIN_VALUE = 0x8000000000000000L; |
is used to The two's complement form represents the number of bits of the long value | @Native public static final int SIZE = 64; |
The two's complement form represents the number of bytes of the long value | public static final int BYTES = SIZE / Byte.SIZE; |
Represents a Class instance of the basic type long | public static final Class |
##Construction method
Construction methods are to create new objects and allocate new space
Constructed in string form, parsed in decimal string form by default
Packaging classUse the corresponding basic data type long to construct |
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
##Packaging class Constructed using the String form of the corresponding basic data type long
|
![]() |
static int compare(long x, long y) |
##Static method 0 x == y; -1 x 1 x > y
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Instance methodCompare two objects, actually compare the value of the two objects Basically still call static int compare(long x, long y) ![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Static methodTwo basic types of int are compared as unsigned numbers and converted through MIN_VALUEIt is still called static int compare(long x, long y)![]() |
static long parseLong(String s, int radix) |
Static methodUse the base (base) specified by the second parameter to parse the string parameter into a signed integer Except that the first character can be the ASCII minus sign '-' ('\u002D') and the plus sign ' ' ('\u002B') used to represent negative values The characters in the string must be specified The number of the base |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| static Decimal simplified form of method static long parseLong(String s, int radix)![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Static method
Use the second one The base (base) specified by the parameter, parses the string parameter into an unsigned integer except that the first character can be an ASCII plus sign ' ' ( '\u002B') External The characters in the string must be numbers in the specified base
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
![]() valueOf series Pack basic basic types into objects Used to create and obtain objects , so there is no need for objects, they are all static methods ##The VaueOf series has a corresponding cache area, and objects within the cache area For the same buffer is an array in a static inner class
|
The above is the detailed content of Detailed analysis of Java data type Long. For more information, please follow other related articles on the PHP Chinese website!

Start Spring using IntelliJIDEAUltimate version...

When using MyBatis-Plus or other ORM frameworks for database operations, it is often necessary to construct query conditions based on the attribute name of the entity class. If you manually every time...

Java...

How does the Redis caching solution realize the requirements of product ranking list? During the development process, we often need to deal with the requirements of rankings, such as displaying a...

Conversion of Java Objects and Arrays: In-depth discussion of the risks and correct methods of cast type conversion Many Java beginners will encounter the conversion of an object into an array...

Solutions to convert names to numbers to implement sorting In many application scenarios, users may need to sort in groups, especially in one...

Detailed explanation of the design of SKU and SPU tables on e-commerce platforms This article will discuss the database design issues of SKU and SPU in e-commerce platforms, especially how to deal with user-defined sales...

How to set the SpringBoot project default run configuration list in Idea using IntelliJ...


Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Safe Exam Browser
Safe Exam Browser is a secure browser environment for taking online exams securely. This software turns any computer into a secure workstation. It controls access to any utility and prevents students from using unauthorized resources.

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Atom editor mac version download
The most popular open source editor

Notepad++7.3.1
Easy-to-use and free code editor

Zend Studio 13.0.1
Powerful PHP integrated development environment