init
This commit is contained in:
27
It_Test.java
Normal file
27
It_Test.java
Normal file
@@ -0,0 +1,27 @@
|
||||
public class It_Test{
|
||||
|
||||
static int i = 1;
|
||||
|
||||
public static int iterator(){
|
||||
i = i * 2;
|
||||
return i;
|
||||
}
|
||||
|
||||
static void printBinary(int num) {
|
||||
for (int shift = 31; shift >= 0; --shift) {
|
||||
System.out.print((num >> shift) & 1);
|
||||
}
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
public static void main(String[] args){
|
||||
boolean run = true;
|
||||
while(run){
|
||||
int next = iterator();
|
||||
System.out.println("Int: " + next);
|
||||
System.out.print("Bin: ");
|
||||
printBinary(next);
|
||||
run = next != 0;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user