Online Java Compiler By
JavaTpoint.com
public class StringValueOfExample2 { public static void main(String[] args) { // Boolean to String boolean bol = true; boolean bol2 = false; String s1 = String.valueOf(bol); String s2 = String.valueOf(bol2); System.out.println(s1); System.out.println(s2); } }
Output