Java and C

Although Java was modelled after C languages, it differs from C in many ways.

 

  • Java is an Object Oriented Programming language whereas C is a procedure oriented programming language
  • 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 the pre-processor and therefore we cannot use #define, #include, etc statements
  • Java requires that the functions with no arguments must be declared with the empty parentheses 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 an object oriented programming
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s