Dies ist eine Methode zur Konvertierung der Basisnummer in Java. Da nur die Standardbibliothek verwendet wird, können Sie diese sofort kopieren und einfügen.
Java
final String bin = "11111110";
final int dec = Integer.parseInt(bin, 2);
final String oct = Integer.toOctalString(dec);
System.out.println(oct);
Ausgabe
376
Java
final String bin = "11111110";
final int dec = Integer.parseInt(bin, 2);
System.out.println(dec);
Ausgabe
254
Java
final String bin = "11111110";
final int dec = Integer.parseInt(bin, 2);
final String hex = Integer.toHexString(dec);
System.out.println(hex);
Ausgabe
fe
Java
final String bin = "11111110";
final int dec = Integer.parseInt(bin, 2);
final String base32 = Integer.toString(dec, 32);
System.out.println(base32);
Ausgabe
7u
Java
final String bin = "11111110";
final int dec = Integer.parseInt(bin, 2);
final int n = 36;
final String base36 = Integer.toString(dec, n);
System.out.println(base36);
Ausgabe
72
Java
final String oct = "376";
final int dec = Integer.parseInt(oct, 8);
final String bin = Integer.toBinaryString(dec);
System.out.println(bin);
Ausgabe
11111110
Java
final String oct = "376";
final int dec = Integer.parseInt(oct, 8);
System.out.println(dec);
Ausgabe
254
Java
final String oct = "376";
final int dec = Integer.parseInt(oct, 8);
final String hex = Integer.toHexString(dec);
System.out.println(hex);
Ausgabe
fe
Java
final String oct = "376";
final int dec = Integer.parseInt(oct, 8);
final String base32 = Integer.toString(dec, 32);
System.out.println(base32);
Ausgabe
7u
Java
final String oct = "376";
final int dec = Integer.parseInt(oct, 8);
final int n = 36;
final String base36 = Integer.toString(dec, n);
System.out.println(base36);
Ausgabe
72
Java
final int dec = 254;
final String bin = Integer.toBinaryString(dec);
System.out.println(bin);
Ausgabe
11111110
Java
final int dec = 254;
final String oct = Integer.toOctalString(dec);
System.out.println(oct);
Ausgabe
376
Java
final int dec = 254;
final String hex = Integer.toHexString(dec);
System.out.println(hex);
Ausgabe
fe
Java
final int dec = 254;
final String base32 = Integer.toString(dec, 32);
System.out.println(base32);
Ausgabe
7u
Java
final int dec = 254;
final int n = 36;
final String base36 = Integer.toString(dec, n);
System.out.println(base36);
Ausgabe
72
Java
final String hex = "fe";
final int dec = Integer.parseInt(hex, 16);
final String bin = Integer.toBinaryString(dec);
System.out.println(bin);
Ausgabe
11111110
Java
final String hex = "fe";
final int dec = Integer.parseInt(hex, 16);
final String oct = Integer.toOctalString(dec);
System.out.println(oct);
Ausgabe
376
Java
final String hex = "fe";
final int dec = Integer.parseInt(hex, 16);
System.out.println(dec);
Ausgabe
254
Java
final String hex = "fe";
final int dec = Integer.parseInt(hex, 16);
final String base32 = Integer.toString(dec, 32);
System.out.println(base32);
Ausgabe
7u
Java
final String hex = "fe";
final int dec = Integer.parseInt(hex, 16);
final int n = 36;
final String base36 = Integer.toString(dec, n);
System.out.println(base36);
Ausgabe
72
Java
final String base32 = "7u";
final int dec = Integer.parseInt(base32, 32);
final String bin = Integer.toBinaryString(dec);
System.out.println(bin);
Ausgabe
11111110
Java
final String base32 = "7u";
final int dec = Integer.parseInt(base32, 32);
final String oct = Integer.toOctalString(dec);
System.out.println(oct);
Ausgabe
376
Java
final String base32 = "7u";
final int dec = Integer.parseInt(base32, 32);
System.out.println(dec);
Ausgabe
254
Java
final String base32 = "7u";
final int dec = Integer.parseInt(base32, 32);
final String hex = Integer.toHexString(dec);
System.out.println(hex);
Ausgabe
fe
Java
final String base32 = "7u";
final int dec = Integer.parseInt(base32, 32);
final int n = 36;
final String base36 = Integer.toString(dec, n);
System.out.println(base36);
Ausgabe
72
Java
final String base36 = "72";
final int n = 36;
final int dec = Integer.parseInt(base36, n);
final String bin = Integer.toBinaryString(dec);
System.out.println(bin);
Ausgabe
11111110
Java
final String base36 = "72";
final int n = 36;
final int dec = Integer.parseInt(base36, n);
final String oct = Integer.toOctalString(dec);
System.out.println(oct);
Ausgabe
376
Java
final String base36 = "72";
final int n = 36;
final int dec = Integer.parseInt(base36, n);
System.out.println(dec);
Ausgabe
254
Java
final String base36 = "72";
final int n = 36;
final int dec = Integer.parseInt(base36, n);
final String hex = Integer.toHexString(dec);
System.out.println(hex);
Ausgabe
fe
Java
final String base36 = "72";
final int n = 36;
final int dec = Integer.parseInt(base36, n);
final String base32 = Integer.toString(dec, 32);
System.out.println(base32);
Ausgabe
7u
Java
final String base36 = "72";
final int n = 36;
final int dec = Integer.parseInt(base36, n);
final int m = 3;
final String base3 = Integer.toString(dec, m);
System.out.println(base3);
Ausgabe
100102
Recommended Posts