'Long.toHexString'
method converts a long to hexa string.
Example
long
number = 255l;
String
hexaString = Long.toHexString(number);
App.java
package com.sample.app; public class App { public static void main(String args[]) { long number = 255l; String hexaString = Long.toHexString(number); System.out.println("number : " + number); System.out.println("hexaString : " + hexaString); } }
Output
number :
255
hexaString
: ff
You may
like
No comments:
Post a Comment