Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

toString convert to long


long l = 12345L;
String str = Long.toString(l);
System.out.println(str); //prints '12345'
Comment

toString convert to long


long l = 12345L;
String str = new StringBuilder().append(l).toString();
Comment

toString convert to long


long l = 0x11L;
String str = Long.toString(l);
System.out.println(str); //prints '17'
l = 011L;
str = Long.toString(l);
System.out.println(str); //prints '9'
Comment

toString convert to long


long l = 12345L;
//deprecated from Java 9, use valueOf for better performance
String str = new Long(l).toString(); // str is '12345'
Comment

toString convert to long


long l = 369L;
String s = String.format("%d", l);
Comment

toString convert to long


long l = 12345L;
String str = String.valueOf(l); // str is '12345'
Comment

toString convert to long


long number = 45;
System.out.println(Long.toBinaryString(number)); //101101
System.out.println(Long.toOctalString(number)); //55
System.out.println(Long.toHexString(number)); //2d
System.out.println(Long.toString(number, 5)); //140
Comment

toString convert to long


long l = 12345L;
String str = DecimalFormat.getNumberInstance().format(l);
System.out.println(str); //str is '12,345'
//if you don't want formatting
str = new DecimalFormat("#").format(l);
System.out.println(str); //str is '12345'
Comment

PREVIOUS NEXT
Code Example
Java :: Integrity check failed: java.security.NoSuchAlgorithmException: Algorithm HmacPBESHA256 not available jks 
Java :: java parse string to list using gson 
Java :: how to decompose a string into words in Java 
Java :: how to check if page in webview or not in android studio 
Java :: set vs list java 
Java :: java loop through string 
Java :: how to create a list in java 
Java :: React-Native Firebase Requests from referer are blocked 
Java :: jsonnode change field value 
Java :: java localdate zoneid example 
Java :: afficher texte java 
Java :: actionlistener java 
Java :: java max from 3 parameters 
Java :: java get keys from tree map 
Java :: cors filter spring boot 
Java :: firestore add to field array 
Java :: how to add image in title bar in android 
Java :: mapsid jpa 
Java :: how to convert an object into string with different fields in java 
Java :: android studio float to int 
Java :: coding collections clear method java 
Java :: how to change orientation of screen in android in fragmetn programmatically 
Java :: java get first 3 characters of string 
Java :: gitignore java 
Java :: convert local datetime to instant java 
Java :: create date java 
Java :: sort string java 
Java :: text.settextcolor android 
Java :: java how to print 
Java :: calendar java add 1 day 
ADD CONTENT
Topic
Content
Source link
Name
3+5 =