Get Adobe Flash player

Tuesday, November 15, 2011

Difference between Java & C


Java i s lot like C but the major difference between Java and C is that Java is an object-oriented langugae and has mechanism to define classes and objects. To build a simple and safe language, the Java team did not include some of the C features in Java.


  • Java does not include the C unique statement keywords sizeof, and typedef.
  • Java does not contain the data types struct and union.
  • Java does not define the type modifiers keywords auto,extern,register,signed, and unsigned
  • Java does not support an explicit pointer type.
  • Java does not have a preprocessor and therefore we can not use #define, #include, and #ifdef statements.
  • Java requires that the function with no arguments must be declared with empty parenthesis and not with the void keyword as done in C.
  • Java adds new operators such as instanceof and >>>.
  • Java adds labelled break and continue statements.
  • Java adds many features required for object oriented programming.

0 comments:

Post a Comment