Integer クラス
- [内容]
- int 型のデータをオブジェクトとして包み込むクラスです.
- [主な変数]
- public static final int MAX_VALUE
- Integer 型データの最大値
- public static final int MIN_VALUE
- Integer 型データの最小値
- [コンストラクタ]
- public Integer(int value)
- public Integer(String s)
- Integer 型に変換される( valueOf )
- [主なメソッド]
- public double doubleValue()
- public int intValue()
- double や int に変換する
- public static int parseInt(String s) throws NumberFormatException
- public static int parseInt(String s, int radix) throws NumberFormatException
- 文字列を int 型データに変換して返す.radix を省略すると 10 とみなされる.
- public static String toBinaryString(int i)
- 2 進文字列に変換
- public static String toHexString(int i)
- 16 進文字列に変換
- public static String toOctalString(int i)
- 8 進文字列に変換
- public String toString()
- public static String toString(int i)
- public static String toString(int i, int radix)
- 文字列に変換する.radix を入力すると,それを基数とした文字列に変換する.
- public static Integer valueOf(String s) throws NumberFormatException
- public static Integer valueOf(String s, int radix) throws NumberFormatException
- Integer に変換する.radix を省略すると 10 とみなされる.
- [使用例]
- プログラム例は,Integer クラスの各メソッド等の使用例です.
- [参照]
- Character, String, StringBuffer, Byte, Double, Boolean, Short