← 返回首页
Long (Java SE 26 & JDK 26)
JavaScript is disabled on your browser.
Contents  
  1. Description
  2. Field Summary
  3. Constructor Summary
  4. Method Summary
  5. Field Details
    1. MIN_VALUE
    2. MAX_VALUE
    3. TYPE
    4. SIZE
    5. BYTES
  6. Constructor Details
    1. Long(long)
    2. Long(String)
  7. Method Details
    1. toString(long, int)
    2. toUnsignedString(long, int)
    3. toHexString(long)
    4. toOctalString(long)
    5. toBinaryString(long)
    6. toString(long)
    7. toUnsignedString(long)
    8. parseLong(String, int)
    9. parseLong(CharSequence, int, int, int)
    10. parseLong(String)
    11. parseUnsignedLong(String, int)
    12. parseUnsignedLong(CharSequence, int, int, int)
    13. parseUnsignedLong(String)
    14. valueOf(String, int)
    15. valueOf(String)
    16. valueOf(long)
    17. decode(String)
    18. byteValue()
    19. shortValue()
    20. intValue()
    21. longValue()
    22. floatValue()
    23. doubleValue()
    24. toString()
    25. hashCode()
    26. hashCode(long)
    27. equals(Object)
    28. getLong(String)
    29. getLong(String, long)
    30. getLong(String, Long)
    31. compareTo(Long)
    32. compare(long, long)
    33. compareUnsigned(long, long)
    34. divideUnsigned(long, long)
    35. remainderUnsigned(long, long)
    36. highestOneBit(long)
    37. lowestOneBit(long)
    38. numberOfLeadingZeros(long)
    39. numberOfTrailingZeros(long)
    40. bitCount(long)
    41. rotateLeft(long, int)
    42. rotateRight(long, int)
    43. reverse(long)
    44. compress(long, long)
    45. expand(long, long)
    46. signum(long)
    47. reverseBytes(long)
    48. sum(long, long)
    49. max(long, long)
    50. min(long, long)
    51. describeConstable()
    52. resolveConstantDesc(MethodHandles.Lookup)
Hide sidebar  Show sidebar

Class Long

All Implemented Interfaces: Serializable, Comparable<Long>, Constable, ConstantDesc
public final class Long extends Number implements Comparable<Long>, Constable, ConstantDesc
The Long class is the wrapper class for values of the primitive type long. An object of type Long contains a single field whose type is long.

In addition, this class provides several methods for converting a long to a String and a String to a long, as well as other constants and methods useful when dealing with a long.

This is a value-based class; programmers should treat instances that are equal as interchangeable and should not use instances for synchronization, or unpredictable behavior may occur. For example, in a future release, synchronization may fail.

Implementation note: The implementations of the "bit twiddling" methods (such as highestOneBit and numberOfTrailingZeros) are based on material from Henry S. Warren, Jr.'s Hacker's Delight, (Addison Wesley, 2002) and Hacker's Delight, Second Edition, (Pearson Education, 2013).

Since: 1.0 See Also:

Scripting on this page tracks web page traffic, but does not change the content in any way.