标签:string char nbsp 显示 code bsp div 相同 har
当所有的构造器都会把一个相同的值赋值给某个指定的实例域时,我们可以进行显示初始化。
public class Dog { private String name = "goudan"; private int age; private char sex; public Dog(int age) { this.age = age; } public Dog(int age, char sex) { this.age = age; this.sex = sex; } }
标签:string char nbsp 显示 code bsp div 相同 har
原文地址:https://www.cnblogs.com/zhju/p/8892138.html