Language
Version: SE 8
Categories
-
User Program Communication
-
Variables
-
Control Flow
-
Object Oriented Programming
-
String Class
String Class
String Representation in Java
Used to return a string representation of a non-string.
Syntax
String stringVariable = String.valueOf(nonString);
Notes
Accepts characters, integer, double, float, long, and objects.
Example
int number = 25;
//will assign "25" to numberAsString
String numberAsString = String.valueOf(number);