Java - Comparison C,C++ and Java - best tricks forever

BEGINNER GUIDE (Hindi)

test banner

Post Top Ad

Responsive Ads Here

Thursday, 29 March 2018

Java - Comparison C,C++ and Java


Comparing C C++ and Java

These are the famous programming languages which differs from each other, let us see

1. Paradigm

C Language is a Procedural Programming language where as C++ and JAVA is Object Oriented programming language

So what is a Procedural Programming Language ?

Procedural Programming language is also called as Imperative programming language which works in linear approach for the solution.

This works step by step linear top to down approach, which executes routine/sub-routine computational steps in linear way.

C++ and Java is Object Oriented programming language

so what is Object Oriented Programming language ?

Object oriented programming language all computational steps are executed by creating class and objects and interating between objects.

These Objects are connected with real world environment.


Note : C++ will support both Paradigm

2. Platform Dependency 

C and C++ are platform dependent programs

so what is platform dependent ?

Programs which depends on Computer Hardware components and Software Components are called as platform dependent.

The execution of C and C++ programs depends on platform, if we take the compiled code and if we try to execute in other Computer hardware and Operating system, and if we try to execute the same program it will not run.

We have to install the compiler in that particular environment and then only the program runs.


Java is Platform Independent programming language 

so what is platform independent ?

The source code of particular program whicn runs in all Hardware/Software components is platform independent

Java have JVM and JRE which compiles the program first as bytecodes and then executes as machine language (0s and 1s) it all platforms irrespective of Hardware/Software components in the computer.

We can copy the byte-code .class file to other platform and execute the same code easily and which works fine.


3. Memory Management


what is Memory management?

Its a process which controls the memory usage of a computer (CPU/RAM/ROM etc.. )

in C and C++ uses lot of procedures where the memory is allocated in heap, for larger programs the developer must have to free the space and for a long running programs uses can lead to use more memory.


In Java Garbage collection process automatically frees the memory used by the objects which is no longer used, So even for a long programs memory management is effectively done.

4. Mutiple Inheritance


what is Multiple Inheritance ?

Multiple inheritance is like inheriting some features from one or multiple parent classed, its the feature of some object oriented languages that allows you toderive a class from multiple parent classes. 

C++ supports Multiple Inheritence but Java supports Multiple Interface.

what is Multiple interface?

Mutiple interface is like inheriting some features like methods/objects which has no implementing procedure in it, but inherited from other class which contains implementing procedures.


5. Operator Overloading 


what is operator overloading ?

Operator overloading enables a class to define special behaviour for built-inoperators when they are applied to objects of that class.

We can change the operational procedure of the build-in operators

C++ supports Operator overloading

C and Java doesnot support Operator overloading.

6. Pointers 


what is pointers ?

Pointer is usually referred as a variable whose value is the address of another variable, by the way this is direct access to the memory location.

C and C++ supports Pointers where as Java doesnot support Pointers.

7. Portability And Performance


C and C++ is procedural program which runs effeciently but lacks in memory management as there is not automatic memery cleaning process involved in it.So for long running programs faces memory issues and memory leaks and that slows the performance of the program.

Java is Object oriented programming language which is also platform independent with Garbage collector inside, cleans the unused memory automatically. So for a long running programs the performance is always higher compared to C and C++ programs

8. Application Programs


C and C++ supports linear programming approach, only system application programs can be created.

In Java we can create Web Applications supports Internet programming.

9. Multithreading


what is multithreading?

More than one action can be done at the same time within a program.

C and C++ doesnot support Multithreading.

Java supports Multithreading.

10. Database connectivity 


We can connect the Databases for performing various operations 

C and C++ dont support Database connectivity.

Java supports Database connectivity.


Listed below in table :

Features
C
C++
Java
Paradigm
Procedural Program
Supports both
Object Oriented Program
Platform Dependency
Platform dependent
Platform Dependent
Platform Independent
Memory Management
Not Efficient
Not Efficient
Efficient
Multiple Inheritance
Supports
Supports
Do Not Support
Multiple interface
Do Not Support
Do Not Support
Supports
Operator Overloading
Do Not Support
Supports
Do Not Support
Pointers
Supports
Supports
Do not Support
Portability And Performance
Low
Low
High
Application
System Applications
System Applications
Web Application
Multithreading
Do Not support
Do Not Support
Supports
Database connectivity
Do Not Support
Do Not Support
Supports














Note :  Hi i am new for blogging, if you think my blog is useful, kindly SUBSCRIBE  in the website and also share this to your friends. And if anything is wrong in the tutorial please correct me and kindly forgive me. Thanks everyone.


No comments:

Post a Comment

Post Bottom Ad

Responsive Ads Here