条款4:Make sure that objects are initialized before they're used.

译:确定对象被使用前已先被初始化.

C++的初始化

先来一个Java的初始化

class Student{

         private String Name;

         private int Age;

         Student(){

                   this.Name = “Destino74”;

                   this.Age = 22;

         }

}
View Code

相关文章: