Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

What Java does is pretty much equivalent to putting an asterisk in your C/C++ typedefs:

    typedef struct _foo* Foo;


I'm guessing this is why you have to call "new" to create new objects in Java?


Java's new is similar to C++'s new as I understand it, yes. It allocates memory, initialises an object, and produces a pointer.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: