Java 中整數的最大可能值是多少?
MAX_VALUE 用於找出 Java 中整數的最大可能值。我們來看看一個例子 -
示例
public class Demo{
public static void main(String[] args){
System.out.println("The type is");
System.out.println(Integer.TYPE);
System.out.println("The size is");
System.out.println(Integer.SIZE);
System.out.println("The max value of integer is");
System.out.println(Integer.MAX_VALUE);
}
}輸出
The type is int The size is 32 The max value of integer is 2147483647
一個名為 Demo 的類使用 Integer 類,並給出 Integer 類的各種特徵,例如型別、大小和最大值。整數可以容納的最大值可以透過使用 MAX_VALUE 值呼叫 Integer 類來計算。它顯示在控制檯上。
廣告
資料結構
網路
RDBMS
作業系統
Java
iOS
HTML
CSS
Android
Python
C 程式設計
C++
C#
MongoDB
MySQL
Javascript
PHP