提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
将布尔对象转换为字符串对象
public class Main { public static void main(String[] args) { /* *来 自 时 代 J a v a - N o w J a v a . c o m */ //construct Boolean object Boolean blnObj = new Boolean("true"); //use toString method of Boolean class to convert it into String String str = blnObj.toString(); System.out.println(str); } }