Detailed analysis of Java data type Long
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) Copy after login | ##Static method 0 x == y; -1 x < y; 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 long parseLong(String s, int radix)![]() | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
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! Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
![]() Hot AI Tools![]() Undresser.AI UndressAI-powered app for creating realistic nude photos ![]() AI Clothes RemoverOnline AI tool for removing clothes from photos. ![]() Undress AI ToolUndress images for free ![]() Clothoff.ioAI clothes remover ![]() Video Face SwapSwap faces in any video effortlessly with our completely free AI face swap tool! ![]() Hot Article
Assassin's Creed Shadows: Seashell Riddle Solution
3 weeks ago
By DDD
What's New in Windows 11 KB5054979 & How to Fix Update Issues
2 weeks ago
By DDD
Where to find the Crane Control Keycard in Atomfall
3 weeks ago
By DDD
Assassin's Creed Shadows - How To Find The Blacksmith And Unlock Weapon And Armour Customisation
1 months ago
By DDD
Roblox: Dead Rails - How To Complete Every Challenge
3 weeks ago
By DDD
![]() Hot Tools![]() Notepad++7.3.1Easy-to-use and free code editor ![]() SublimeText3 Chinese versionChinese version, very easy to use ![]() Zend Studio 13.0.1Powerful PHP integrated development environment ![]() Dreamweaver CS6Visual web development tools ![]() SublimeText3 Mac versionGod-level code editing software (SublimeText3) ![]() Hot Topics
CakePHP Tutorial
![]() ![]() ![]() Guide to Perfect Number in Java. Here we discuss the Definition, How to check Perfect number in Java?, examples with code implementation. ![]() Guide to Weka in Java. Here we discuss the Introduction, how to use weka java, the type of platform, and advantages with examples. ![]() Guide to Smith Number in Java. Here we discuss the Definition, How to check smith number in Java? example with code implementation. ![]() In this article, we have kept the most asked Java Spring Interview Questions with their detailed answers. So that you can crack the interview. ![]() Java 8 introduces the Stream API, providing a powerful and expressive way to process data collections. However, a common question when using Stream is: How to break or return from a forEach operation? Traditional loops allow for early interruption or return, but Stream's forEach method does not directly support this method. This article will explain the reasons and explore alternative methods for implementing premature termination in Stream processing systems. Further reading: Java Stream API improvements Understand Stream forEach The forEach method is a terminal operation that performs one operation on each element in the Stream. Its design intention is ![]() Guide to TimeStamp to Date in Java. Here we also discuss the introduction and how to convert timestamp to date in java along with examples. ![]() Capsules are three-dimensional geometric figures, composed of a cylinder and a hemisphere at both ends. The volume of the capsule can be calculated by adding the volume of the cylinder and the volume of the hemisphere at both ends. This tutorial will discuss how to calculate the volume of a given capsule in Java using different methods. Capsule volume formula The formula for capsule volume is as follows: Capsule volume = Cylindrical volume Volume Two hemisphere volume in, r: The radius of the hemisphere. h: The height of the cylinder (excluding the hemisphere). Example 1 enter Radius = 5 units Height = 10 units Output Volume = 1570.8 cubic units explain Calculate volume using formula: Volume = π × r2 × h (4 ![]() Java is a popular programming language that can be learned by both beginners and experienced developers. This tutorial starts with basic concepts and progresses through advanced topics. After installing the Java Development Kit, you can practice programming by creating a simple "Hello, World!" program. After you understand the code, use the command prompt to compile and run the program, and "Hello, World!" will be output on the console. Learning Java starts your programming journey, and as your mastery deepens, you can create more complex applications. ![]() |