Follow along with the video below to see how to install our site as a web app on your home screen.
Anmerkung: This feature may not be available in some browsers.
int x = Integer.parseInt("11001100", 2);
public class MyTest {
public static void main(String[] args) {
long time1, time2;
int x, max;
max = 2000000;
// Test 1
time1 = System.currentTimeMillis();
for (int i = 0; i <= max; i++)
{
x = Integer.parseInt("11001100", 2);
}
time1 = System.currentTimeMillis() - time1;
// Test2
time2 = System.currentTimeMillis();
for (int i = 0; i <= max; i++)
{
x = 0x1B6;
}
time2 = System.currentTimeMillis() - time2;
//Ausgabe
System.out.println(time1);
System.out.println(time2);
}
}
...
case (i & :100100100 == 0)
case (i & :110110110 == 0)
case (i & :111111111 == 0)
case (i & :011011011 == 0)
case (i & :001001001 == 0)
...
nicht mit enums bei java 5 :wink:skaal hat gesagt.:die case-abfrage geht in java eh nicht, da nur integere typen akzeptiert werden.
if((i & 11111111b) == 0) System.out.println("perhaps");
else if((i & 10101010b) == 0) System.out.println("also");
else if((i & 00100100b) == 0) System.out.println("without");
else if((i & 10001000b) == 0) System.out.println("else");