Java Conversion

We can convert Java Long to String using the following methods: String.valueOf() method Long.toString() method Convert Java Long to String using the String.valueOf() method There are multiple overloaded versions of the valueOf() method from the String class. We will use the one which accepts long. Example class Test { public static void main(String[] args) {…

Read More Convert Java Long to String

In one of the previous posts, we covered the conversion of a Decimal to Hexadecimal. Here, you will learn how to convert Hexadecimal to Decimal in Java. We will explore the following ways: Using the parseInt() method Using custom logic Convert Hexadecimal to Decimal in Java using the parseInt() method Integer class has a method…

Read More Convert Hexadecimal to Decimal in Java

There are two ways to convert Decimal to Hexadecimal in Java: Using the toHexString() method  With a custom logic Convert Decimal to Hexadecimal in Java using the toHexString() method The easiest way is to use the ToHexString() method of the Integer class to get the Hexadecimal String of a Decimal number. Example class Test { public static…

Read More Convert Decimal to Hexadecimal in Java