Thursday 20 March 2014

Features Removed from C and C++

1. tyedefs, header files, preprocessor directives removed
    Source code in Java is context-free, It won't confuse you from different features. To define a constants no need to use #define, you can use final keyword in Java. Header files are replaced by classes. Classes are used to create user defined data types which are better replacement for typedefs.

2. Structures and unions removed 
    Classes replaces the concept of structures and unions.

3.  Goto statements removed 
    using goto many places makes the debugging miserable. Elimination of goto simplify the language. 

4.  No more multiple inheritance 
    Multiple inheritance removed from java. It is indirectly achieved by using interfaces.

5. Pointers and operator overloading removed. 
    Elimination of operator overloading and pointers makes the Java language simple to use. Pointers is the key area, where there is a chance, critical bugs to occur. In Java, since there is no pointers, Developer has no direct interaction with the memory. 

6.  No more Automatic conversions 
    Java doesn't support automatic type conversion of higher data type to lower type.
  Ex:
     float f1=10.01
    int a = (int) f;

   User has to specify explicitly.
Prevoius                                                 Next                                                 Home

No comments:

Post a Comment