Is there a method to help with the essence conversion in Java?

Asked 1 years ago, Updated 1 years ago, 134 views

I want to make a game that helps me understand the essence, but I need to convert it to compare the answers to the questions. I can implement it myself, but if there is a method supported by Java, it will be better I'd like to use that, but is there a method to help me transform the essence?

hex java binary decimal-number

2022-09-22 22:14

1 Answers

The Integer class contains methods that support these features. There are toBinaryString, toOctalString, toHexString. A method that, as the name implies, replaces binary, octal, and hexadecimal numbers.

Integer.toBinaryString(10); If you insert int-type data into the parameter in this way, it returns a binary string. Conversely, if you use Integer.valueOf;, you can use a string that is included in the first parameter for the second parameter Change it to the appropriate integer and return it to int type.


2022-09-22 22:14

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.