2 |
Some differences
-
No malloc or free - it has automatic garbage collection.
-
No pointers - designers felt pointer arithmetic not robust or safe.
-
Can declare variables almost anywhere as needed.
-
No struct, union, enum, typedef from C- it has classes and objects instead.
-
Primitive types for integers and floats have machine independent semantics.
-
Booleans in Java have value either "true" or "false" (not 0,1,...).
|