Name: Anonymous 2012-06-13 10:19
Lets compare these two pieces of code that create new integer.
C
Java
- C assigns memory from stack. Everyone knows about the stack overflow problems. Stack allocation is bad.
- Java assigns memory from heap. Heap is good. Heap won't overflow.
- Java makes it more clear that new integer is created by saying
- C uses
The conclusion is that Java is much better language than C.
C
int i;Java
Integer i = new Integer();- C assigns memory from stack. Everyone knows about the stack overflow problems. Stack allocation is bad.
- Java assigns memory from heap. Heap is good. Heap won't overflow.
- Java makes it more clear that new integer is created by saying
new Integer. This makes Java much easier to read than C.- C uses
int as the name for its integer type. What does int even mean? interrupt? intelligence? Calling it Integer makes much more sense.The conclusion is that Java is much better language than C.