Java vs. C#

new


Java
 
With reference types, the new keyword instantiate objects on the heap.
You cannot use new to instantiate a primitive type.





C#
 
With reference types, the new keyword instantiate objects on the heap, 
but with value types such as structs, the object is created 
on the stack and a constructor is called. You can, in fact, 
create a struct on the stack without using new, 
but you must initialize all the values in the struct by hand 
before you use it (before you pass it to a method) 
or it won't compile.