How to set binary value to an integer in Java

1 Answer

0 votes
public class MyClass {
    public static void main(String args[]) {
        int x = 0b1011;

        System.out.println(x);
    }
}



/*
run:

11

*/

 



answered May 26, 2019 by avibootz

Related questions

2 answers 174 views
1 answer 135 views
1 answer 192 views
1 answer 180 views
1 answer 172 views
3 answers 253 views
...