0
Why doesn't constructors in java don't have a return type? not even void? The are functions too right?
2 Respostas
0
From a point of view yes. As with many kinds of Java, they only make sense when you also know C++. When you create a C++ object on the stack, it doesn't really look like a method call. In late languages like Ruby on the other hand, it looks even more like a function than in Java.
If a constructor had a return type, it would be the constructed type.