long類型20位示例_Java Long類reverseBytes()方法與示例

long類型20位示例

長類reverseBytes()方法 (Long class reverseBytes() method)

  • reverseBytes() method is available in java.lang package.

    reverseBytes()方法在java.lang包中可用。

  • reverseBytes() method is used to returns the value generated by reversing the order of bytes in binary 2's complement denotation of the given argument.

    reverseBytes()方法用于返回通過反轉給定參數的二進制2的補碼表示形式的字節順序而生成的值。

  • reverseBytes() method is a static method, it is accessible with the class name too and if we try to access the method with the class object then also we will not get an error.

    reverseBytes()方法是一個靜態方法,也可以使用類名進行訪問,如果我們嘗試使用類對象訪問該方法,那么也不會出錯。

  • reverseBytes() method does not throw an exception at the time of reversing the order of bytes.

    reverseBytes()方法在反轉字節順序時不會引發異常。

Syntax:

句法:

    public static long reverseBytes (long value);

Parameter(s):

參數:

  • long value – represents the long value to be parsed.

    long value –表示要解析的long值。

Return value:

返回值:

The return type of this method is long, it returns a long value generated by reversing the bytes order in 2's complement of the given long value.

此方法的返回類型為long ,它返回通過以給定long值的2的補碼反轉字節順序生成的long值。

Example:

例:

// Java program to demonstrate the example 
// of reverseBytes(long value) method of Long class
public class ReverseBytesOfLongClass {
public static void main(String[] args) {
long value = 1296;
// Display value
System.out.println("value: " + value);
// It returns the string representation of the given unsigned 
// long value denoted by the argument in binary by calling
// Long.toBinaryString(value)
System.out.println("Long.toBinaryString(value): " + Long.toBinaryString(value));
// It returns the value generated by reversing the order of the 
// bytes in the given argument value by calling //Long.reverseBytes(value)
System.out.println("Long.reverseBytes(value): " + Long.reverseBytes(value));
}
}

Output

輸出量

value: 1296
Long.toBinaryString(value): 10100010000
Long.reverseBytes(value): 1154328879490400256

翻譯自: https://www.includehelp.com/java/long-class-reversebytes-method-with-example.aspx

long類型20位示例

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/541809.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/541809.shtml
英文地址,請注明出處:http://en.pswp.cn/news/541809.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

impala和mysql語法,impala CREATE TABLE語句

CREATE TABLE語句用于在Impala中的所需數據庫中創建新表。 創建基本表涉及命名表并定義其列和每列的數據類型。語法以下是CREATE TABLE語句的語法。 這里,IF NOT EXISTS是一個可選的子句。 如果使用此子句,則只有在指定數據庫中沒有具有相同名稱的現有表…

Guava翻譯系列之EventBus

EventBus 類解析 當我們開發軟件時,各個對象之間的數據共享和合作是必須的。 但是這里比較難做的是 怎樣保證消息之間的傳輸高效并且減少各個模塊之間的耦合。 當組件的職責不清楚時,一個組件還要承擔另一個組件的職責,這樣的系統我們就認為是…

Java PipedOutputStream close()方法與示例

PipedOutputStream類close()方法 (PipedOutputStream Class close() method) close() method is available in java.io package. close()方法在java.io包中可用。 close() method is used to close this PipedOutputStream and free all system resources linked with this str…

Java二維數組谷電,java二維數組遍歷的2種代碼

二維數組遍歷:思想:1.先將二維數組中所有的元素拿到2.再將二維數組中每個元素進行遍歷,相當于就是在遍歷一個一維數組第一種方法:雙重for循環//遍歷二維數組public class Traverse_a_two_dimensional_array {public static void m…

【轉】MyEclipse快捷鍵大全

常用快捷鍵 -------------------------------------MyEclipse 快捷鍵1(CTRL)-------------------------------------Ctrl1 快速修復CtrlD: 刪除當前行 CtrlQ 定位到最后編輯的地方 CtrlL 定位在某行 CtrlO 快速顯示 OutLine CtrlT 快速顯示當前類的繼承結構 CtrlW 關閉當…

Java整數類的compareTo()方法和示例

整數類compareTo()方法 (Integer class compareTo() method) compareTo() method is available in java.lang package. compareTo()方法在java.lang包中可用。 compareTo() method is used to check equality or inequality for this Integer object against the given Integer…

MATLAB元胞自動機報告,元胞自動機概述與MATLAB實現

什么是元胞自動機?元胞自動機(cellular automata,CA) 是一種時間、空間、狀態都離散,空間相互作用和時間因果關系為局部的網格動力學模型,具有模擬復雜系統時空演化過程的能力。它能構建隨時間推移發生狀態轉移的系統,…

python(33)多進程和多線程的區別

多線程可以共享全局變量,多進程不能。多線程中,所有子線程的進程號相同;多進程中,不同的子進程進程號不同。 #!/usr/bin/python # -*- coding:utf-8 -*- import os import threading import multiprocessing count_thread 0 coun…

Java FilterInputStream reset()方法與示例

FilterInputStream類的reset()方法 (FilterInputStream Class reset() method) reset() method is available in java.io package. reset()方法在java.io包中可用。 reset() method is used to reset this FilterInputStream to the position set by the most recent call of m…

不同php文件,php-不同文件夾的不同登錄(會話)

我有一個Web服務,需要用戶登錄并創建標準$_SESSION [‘XXX’]個用戶變量.我想為應用程序創建一個“演示”,因此為它創建了另一個文件夾.相同的代碼在那里,除了數據庫以外的所有東西.問題是,當用戶登錄這兩個帳戶之一時,它可以訪問兩個帳戶.因此,如果他登錄了演示應用程序,它將使…

Java Hashtable containsValue()方法與示例

哈希表類containsValue()方法 (Hashtable Class containsValue() method) containsValue() method is available in java.util package. containsValue()方法在java.util包中可用。 containsValue() method is used to check whether this table Hashtable associated one or m…

php session redis db,php session redis 配置

具體環境:一臺apachephp的服務器(yum安裝remi源及配置 httpd-2.2.15 php-5.4.45)一臺redis服務器(yum安裝remi源及配置 redis-3.2.6)保證apache服務器可以訪問redis服務器的6379端口具體步驟:1、在apachephp服務器上安裝redis擴展點擊(此處)折疊或打開yu…

sigprocmask, sigpending, sigsuspend的用法

sigset_t set sigemptyset(&set) :清空阻塞信號集合變量 sigfillset(&set) :添加所有的信號到阻塞集合變量里 sigaddset(&set,SIGINT):添加單一信號到阻塞信號集合變量 sigdelset(&set,SIGINT):從阻塞信號集合變量中刪除單一信號 void handler(int …

Java Calendar getDisplayName()方法與示例

日歷類的getDisplayName()方法 (Calendar Class getDisplayName() method) getDisplayName() method is available in java.util package. getDisplayName()方法在java.util包中可用。 getDisplayName() method is used to return string denotation of the given calendar fie…

matlab dir數,DIR - matlab函數

DIR List directory.DIR directory_name lists the files in a directory. Pathnames andwildcards may be used. For example, DIR *.m lists all the M-filesin the current directory.D DIR(‘directory_name‘) returns the results in an M-by-1structure with the field…

(四)其他的說明

2019獨角獸企業重金招聘Python工程師標準>>> 關于日志,主要是利用aop來實現的。cn.demoframe.test.frame.service.LogAspect,這里在方法前做了個切面setReqReachTime,設置了一個請求達到時間。接下來還有個切面,是在co…

Java LocalDate類| 帶示例的compareTo()方法

LocalDate類compareTo()方法 (LocalDate Class compareTo() method) compareTo() method is available in java.time package. compareTo()方法在java.time包中可用。 compareTo() method is used to compare this LocalDate object to the given object. compareTo()方法用于將…

vm中linux物理內存不足解決方案

為什么80%的碼農都做不了架構師?>>> 之前創建的一個center os,默認是8GB,經過一頓折磨,裝jdk,tomcat,redis,mycat,nginx,mysql,hadoop...終于,內存不足了,在使用docker build某鏡像的時候。迭代懵逼了&am…

matlab7.0 6.5,任何處理matlab6.5與7.0.1的兼容問題

mdl文件在6.5里面做的,但是到了7.0里面卻打不開,下面就是相關信息:Warning: Unable to load model file d:\MATLAB7\work\*.mdl. Run "bdclose all; set_param(0, CharacterEncoding, Enc)" where Enc is one of windows-1252, I…

Java BigInteger類| 帶有示例的減去()方法

BigInteger類減去()方法 (BigInteger Class subtract() method) subtract() method is available in java.math package. exclude()方法在java.math包中可用。 subtract() method is used to subtract the given value from the value of this BigInteger. exclude()方法用于從…