Java has default constructor but is not functioning in the same way as C++.
In C++ default constructor is implicitly called when the object is declared so no need to explicit “new” it. But in Java an object must be explicitly initialized. Is there a special reason for that? Was there any feature request for this?
Only if the C++ declaration is creating an object on the stack. All Java objects are heap-based, so that’s not an option. In both languages the constructor is called when a new object is created.