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);

Add to Slack

< Substring   |   Print >

© 2019 SyntaxDB. All Rights Reserved.