1.Integer. toBinaryString(int n);
2.
void getBinary(int n){
for (int i=31;i>=0;i++){
System.out.print((((n>>i)&1 )==1)?"1":"0")
}