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 279 views
1 answer 217 views
1 answer 275 views
1 answer 270 views
1 answer 268 views
3 answers 371 views
...