此方法将自身返回一个字符串。
public String toString()
import java.io.*; public class Test { public static void main(String args[]) { String Str=new String("Welcome to Learnfk.com"); System.out.print("返回值 :"); System.out.println(Str.toString()); } }
这将产生以下输出-
返回值 :Welcome to Learnfk.com
祝学习愉快!(内容编辑有误?请选中要编辑内容 -> 右键 -> 修改 -> 提交!)
Spring Boot与Kubernetes云原生微服务实践 -〔杨波〕