标签:ati 学习 基础学习篇 调用 case style system oid upper
1.使用this调用构造方法市一定放在构造方法的首行
2.使用this调用构造方法时一定流出调用的出口
public class MyClass {
public MyClass(){
System.out.printf("调用无参数的构造方法");
}
public MyClass(String name) {
this();
System.out.printf("调用一个参数的构造方法");
}
public MyClass(String name , int a) {
this(name);
System.out.printf("调用两个参数的构造方法");
}
public static void main(String[] args){
MyClass myClass = new MyClass("zz" , 20);
}
public static String initCap(String s){
return s.substring(0, 1).toUpperCase().concat(s.substring(1));
}
}
标签:ati 学习 基础学习篇 调用 case style system oid upper
原文地址:https://www.cnblogs.com/liunx1109/p/9780738.html