This question already has an answer here:
I do not know much about OO-languages, but from what I have seen, it seems most class-based OO-languages uses a keyword
From a viewpoint of keeping the syntax simple, why not leave out the
new keyword and use only the constructor (typically of the same name as the class)?
Is there any semantic consideration involved in prefixing the constructor with a
I have noticed that in Scala, if you define a
case-class, you can simply use the constructor without a preceding
new to create an object, while for other classes, you have to use
new. I do not know the reason. I mention it simply because it may be related.