Thanks to visit codestin.com
Credit goes to www.java2s.com
Home
Java
2D Graphics GUI
3D
Advanced Graphics
Ant
Apache Common
Chart
Class
Collections Data Structure
Data Type
Database SQL JDBC
Design Pattern
Development Class
EJB3
Email
Event
File Input Output
Game
Generics
GWT
Hibernate
I18N
J2EE
J2ME
JavaFX
JDK 6
JDK 7
JNDI LDAP
JPA
JSP
JSTL
Language Basics
Network Protocol
PDF RTF
Reflection
Regular Expressions
Scripting
Security
Servlets
Spring
Swing Components
Swing JFC
SWT JFace Eclipse
Threads
Tiny Application
Velocity
Web Services SOA
XML
Convert to String « Data Type « Java
Java
Data Type
Convert to String
1.
Convert an int value to String: Integer.toString(i)
2.
Use toString method of Integer class to conver Integer into String.
3.
Convert an int value to String: new Integer(i).toString()
4.
Convert an int value to String: concatenate string to an int value
5.
Convert from integer to String
6.
Convert a byte array to a Hex string
7.
To catch illegal number conversion, try using the try/catch mechanism.
8.
The Value of a String with String.valueOf method