《代码大全第二版》书的P140:class Employee{
public:
Employee();
FullName getName()const;
String getAddress()const;
private:
String name; //书中说,此处的private的声明放在类的头文件中是不好的。
String address;
String jobClass;
}需要用:class Employee{
public:
Employee();
FullName getName()const;
String getAddress()const;
private:
EmployeeImplementation * implementation;
}但是如果用Java写程序,我们一般好像都是用第一种方式写的,是否是书中说的是不好的?有没有什么改进方法。求高手解答