Converting bool to a string in Java
Forums:
boolean sunIsStar = true;
String str1 = Boolean.toString(sunIsStar);
//str1 is "True"
Boolean earthIsStar = false;
String str2 = earthIsStar.toString();
//str2 is "True"
- Log in to post comments
boolean sunIsStar = true;
String str1 = Boolean.toString(sunIsStar);
//str1 is "True"
Boolean earthIsStar = false;
String str2 = earthIsStar.toString();
//str2 is "True"