How do I output Integer in binary format in Java?

Asked 2 years ago, Updated 2 years ago, 29 views

How do I have a number and print it out in binary?

java

2022-09-22 22:13

1 Answers

int x = 100;
System.out.println(Integer.toBinaryString(x));

You can do it like this


2022-09-22 22:13

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.