Obvious differences from C, C++
No low-level pointers or pointer arithmetic.
- Instead have variables and expressions of reference type.
No malloc() or free()—instead have a “new” operator for creating objects, plus automatic garbage collection.
Can declare variables almost anywhere (like C++).
No struct, union, enum, typedef—classes and objects are used uniformly instead.