在new一个对象时候,如果对象调用的是默认构造函数,则在C++中可以省略“()”,而java则禁止:

string *s = new string; //ok, c++

String s = new string; //error in java

相关文章: