tooctalstring_Java Long類toOctalString()方法的示例

tooctalstring

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

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

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

  • toOctalString() method is used to represent an octal string of the given parameter [value] of long type as an unsigned long in base 8.

    toOctalString()方法用于在基數8中將long類型給定參數[value]的八進制字符串表示為無符號long。

  • toOctalString() 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.

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

  • toOctalString() method does not throw an exception at the time of conversion from long integer to an octal string.

    從長整數轉換為八進制字符串時, toOctalString()方法不會引發異常。

Syntax:

句法:

    public static String toOctalString (long value);

Parameter(s):

參數:

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

    long value –表示要轉換的long值。

Return value:

返回值:

The return type of this method is String, it returns the octal string of the given parameter that represent the unsigned long value.

此方法的返回類型為String ,它返回給定參數的八進制字符串,該字符串表示無符號long值。

Example:

例:

// Java program to demonstrate the example 
// of toOctalString (long value) method of Long class
public class ToOctalStringOfLongClass {
public static void main(String[] args) {
// Variables initialization
long l1 = 10;
long l2 = 20;
long l3 = 30;
long l4 = Long.MAX_VALUE;
long l5 = Long.MIN_VALUE;
// Long instance creation
Long value = new Long(l1);
// It represents Octal string of the given
// long type l2 argument
String s = value.toOctalString(l2);
// Display Octal String Representation
System.out.println("value.toOctalString(l2): " + s);
// It represents Octal string of the given
// long type l3 argument
s = value.toOctalString(l3);
// Display Octal String Representation
System.out.println("value.toOctalString(l3): " + s);
// It represents Octal string of the given
// long type l4 argument
s = value.toOctalString(l4);
// Display Octal String Representation
System.out.println("value.toOctalString(l4): " + s);
// It represents Octal string of the given
// long type l5 argument
s = value.toOctalString(l5);
// Display Octal String Representation
System.out.println("value.toOctalString(l5): " + s);
}
}

Output

輸出量

value.toOctalString(l2): 24
value.toOctalString(l3): 36
value.toOctalString(l4): 777777777777777777777
value.toOctalString(l5): 1000000000000000000000

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

tooctalstring

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

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

相關文章

匯編語言-009(表驅動選擇 、條件控制流偽指令 、邏輯移位SHL,SHR 算術移位SAL,SAR)

1: 表驅動選擇,用查表來代替多路選擇結構的一種方法 .386 .model flat,stdcallinclude Irvine32.inc.stack 4096 ExitProcess PROTO,dwExitCode:DWORD.data CaseTable BYTE A ;查詢值DWORD Process_A ;過程地址 EntrySize ($ - CaseT…

如何解決EDM郵件營銷中的圖片難題

隨著互聯網的高速發展,已然進入到了讀圖時代,EDM郵件營銷尤為注重圖片的運用。純文本的郵件太枯燥,巧借圖片,可以提高內容的可讀性,吸引用戶注意力。然而,我們卻常常不得不面對這樣的尷尬:打開郵…

實驗2 SQL Server 表操作

實驗2 SQL Server 表操作一、實驗目的 1.了解表設計和表結構相關知識。 2.掌握管理工具創建、修改、查看和刪除表的方法。 3.掌握T-SQL語句創建、修改、查看和刪除表的方法。 4.了解表和數據庫的關系。 二、實驗要求 1.創建好的“網上購物系統”數據庫eshop中的members表、pro…

深入理解.net的事件與委托機制

首先介紹一個為什么要在事件中引入委托這個概念:  事件是對象發送的消息,以發信號通知操作的發生。操作可能是由用戶交互(例如鼠標單擊)引起的,也可能是由某些其他的程序邏輯觸發的。引發事件的對象稱為事件發送方。…

Java ObjectOutputStream flush()方法與示例

ObjectOutputStream類flush()方法 (ObjectOutputStream Class flush() method) flush() method is available in java.io package. flush()方法在java.io包中可用。 flush() method is used to flush this stream and write bytes immediately of any buffered output to the u…

ffmpeg 命令裁剪合并

1 mp4格式: 裁剪從一個視頻中的1分鐘、2分鐘、3分鐘開始截取10秒 ffmpeg -i test_1280x720.mp4 -ss 00:01:00 -t 10 -codec copy copy1.mp4 ffmpeg -i test_1280x720.mp4 -ss 00:02:00 -t 10 -codec copy copy2.mp4 ffmpeg -i test_1280x720.mp4 -ss 00:03:00 -t 10…

Struts2初始化流程及源碼分析

1.1 Struts2初始化 在講Struts2的初始化之前,應該為大家描述下Web應用中的過濾器Filter,這關系到我們對核心過濾器FilterDispatcher的正確理解。 Filter:一個filter是一個對象,為每個請求資源(一個servlet或靜態內容) &#xff0c…

實驗1 數據庫操作

實驗1 數據庫操作一、實驗目的 1.掌握管理工具、T-SQL創建數據庫的方法。 2.掌握管理工具、T-SQL修改和查看數據庫的方法。 3.掌握管理工具、T-SQL刪除數據庫的方法。 4.掌握數據庫的附加與分離 二、實驗要求 1.創建實驗所用到的“網上購物系統”數據庫eshop。 三、實驗內容 1…

Java FileInputStream finalize()方法與示例

FileInputStream類的finalize()方法 (FileInputStream Class finalize() method) finalize() method is available in java.io package. finalize()方法在java.io包中可用。 finalize() method is used to assure that close() method of this FileInputStream invokes when th…

逆風飛揚,吳仁宏

摘自逆風飛揚,吳仁宏自傳 它是一個從"生而自卑"到"個性飛揚"的故事,當然具有傳奇色彩 中國人幾千年都不是天生的贏家,讓我們努力,為國為家為自己,做贏家! 生存哲學 尼采 痛苦,挫折使生命遷長,使人…

ffmpeg 命令圖片和視頻相互轉換

1當前文件環境: ffmpeg -i test.mp4 -y -f image2 -ss 00:00:02 -vframes 1 -s 640x360 test.jpg ffmpeg -i test.mp4 -y -f image2 -ss 00:00:02 -vframes 1 -s 640x360 test.bmp 使用ffplay test.jpb ffplay test.bmp 都是可以打開的 參數介紹: -y 如…

如何點擊鏈接直接跳轉到app store指定應用下載頁面

轉載自:http://blog.csdn.net/zengconggen/article/details/6789420 NSString *str [NSString stringWithFormat:"http://itunes.apple.com/us/app/id%d", 436957167]; [[UIApplication sharedApplication] openURL:[NSURL urlWithString:str]];其中&…

COLLEGE.sql(復制的時候注意路徑!!!)

USE [master] GO /****** Object: Database [COLLEGE] Script Date: 2019/11/25 星期一 上午 08:57:11 / CREATE DATABASE [COLLEGE] ON PRIMARY ( NAME N’COLLEGE_m’, FILENAME N’F:\COLLEGE\COLLEGE.mdf’ , SIZE 51200KB , MAXSIZE UNLIMITED, FILEGROWTH 10240KB )…

【管理】「本能叛逆」與「理性叛逆」

叛逆是一般人認知的負面名詞,但是,很多人都忽略掉,它卻是人類進步的重要因子。觀察孩童的成長過程,十歲以后都會出現叛逆行為,相當令父母及師長頭痛。然而,叛逆卻是促使孩童突破家庭單一環境養成的認知與觀…

Java Double類parseDouble()方法的示例

Double類parseDouble()方法 (Double class parseDouble() method) parseDouble() method is available in java.lang package. parseDouble()方法在java.lang包中可用。 parseDouble() method is used to return the double value corresponding to the given String or in oth…

ffmpeg命令 拉流

1: 拉流播放:rtmp (ffplay rtmp://server/live/streamName) ffplay -x 480 -y 320 rtmp://58.200.131.2:1935/livetv/cctv1 2: 拉流存儲到文件:rtmp ffmpeg -i rtmp://58.200.131.2:1935/livetv/cctv1 -codec copy cctvrtmp.f…

小心pthread_cond_signal和SetEvent之間的差異

ZZ FROM: http://blog.csdn.net/absurd/article/details/1402433 轉載時請注明出處和作者聯系方式&#xff1a;http://blog.csdn.net/absurd 作者聯系方式&#xff1a;Li XianJing <xianjimli at hotmail dot com> 更新時間&#xff1a;2006-12-19 今天幫同事查一個多線…

eshop.sql(復制的時候注意路徑!!!)

USE [master] GO /****** Object: Database [eshop] Script Date: 2019/11/25 星期一 上午 08:54:14 / CREATE DATABASE [eshop] ON PRIMARY ( NAME N’eshop_dat’, FILENAME N’D:\eshop\eshop_dat.mdf’ , SIZE 10240KB , MAXSIZE 51200KB , FILEGROWTH 5120KB ) LOG O…

doublevalue_Java Double類doubleValue()方法與示例

doublevalueDouble類doubleValue()方法 (Double class doubleValue() method) doubleValue() method is available in java.lang package. doubleValue()方法在java.lang包中可用。 doubleValue() method is used to return the value denoted by this Double object converted…

ffmpeg 命令過濾器裁剪

1 圖片操作&#xff1a; 原圖&#xff1a; 使用ffplay 顯示左半邊 ffplay -i input.png -vf cropiw/2:ih:0:0 可以通過ffmpeg 保存 ffmpeg -i input.png -vf cropiw/2:ih:0:0 out.png 2 視頻操作&#xff1a; 原視頻&#xff1a; 顯示左半邊 ffplay -i cctvhttp.flv -vf …