Possible Duplicate:
Why do C# and Java bother with the “new” operator?
Why does java have the new keyword? To create an object of type A
, I have to type A a = new A()
.
Java doesn't have stack allocation, so why couldn't that just be simplified to A a = A()
?