Saturday, 9 March 2013

Differences Between Java and C

  In this post I am listing out some differences between Java and C. Of course it does not cover all the differences between Java and C.

  • Java is an Object Oriented Programming Language, where as C is a Procedural Programming Language.
  • Java does not have the C Keywords sizeof and typedef.
  • There are no structures and unions in Java. Consequently the C Keywords struct and union are absent in Java.
  • Type Modifiers auto, extern, register, signed and unsigned present in C are not there in Java.
  • Explicit pointers are not supported in Java.
  • There is no preprocessor for java. So statements like #define, #include etc are absent in Java.
  • In Java functions with no argument must be declared with empty parenthesis. In C this can be done by using the void keyword.
  • New operators such as >>> and instanceof are added in Java.
  • Java supports labelled breaks and continue statements.
  • New data types like boolean, reference etc. are added in Java. 
  • Many new keywords like private, protected, public etc are added in Java.

No comments:

Post a Comment