C compiler CPU
C Prog. ----------------->m/c code--------------> o/p
m/c code looks like : mov cx,0x0004
Thus C is platform dependent.
The Java compiler does not produce native executable code for a particular machine like a C
compiler would. Instead it produces a special format called byte code.Java byte code written in
hexadecimal, byte by byte,looks like this:
CA FE BA BE 00 03 00 2D 00 3E 08 00 3B 08 00 01 08 00 20 08
JavaC compiler JVM CPU
Java Prog--------------------> bytecode----------------> native language------------------> o/p
Thus Java is platform dependent.
| Difference between Java and C | |
| Java | C |
| Object oriented prog. | Procedure oriented prog |
| No Pointer | Uses pointer |
| automatically garbage collection | manually garbage collection using malloc() and free |
| variables can be declared anywhere | variable should be declared in the beginning |
| Compiled to bytecode | Compiled to machine code |
| Plateform independent | Plateform dependent |
No comments:
New comments are not allowed.