How to convert integer to binary in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        int n = 14;
  
        System.out.println(Integer.toBinaryString(n));
    }
}
 
 
 
/*
run:
 
1110
 
*/

 



answered Jul 23, 2020 by avibootz

Related questions

1 answer 224 views
2 answers 182 views
1 answer 167 views
1 answer 98 views
1 answer 107 views
107 views asked Nov 17, 2024 by avibootz
1 answer 125 views
...