0% found this document useful (0 votes)
1 views

Difference Between Java and C

Java is a platform-independent language primarily used for application programming, while C++ is platform-dependent and mainly used for system programming. Java emphasizes ease of use and accessibility, lacking certain features like multiple inheritance and pointers, whereas C++ supports these features and is closer to hardware. Additionally, Java has built-in thread support and virtual methods by default, while C++ relies on third-party libraries for thread support and has separate inheritance trees.

Uploaded by

atul
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
1 views

Difference Between Java and C

Java is a platform-independent language primarily used for application programming, while C++ is platform-dependent and mainly used for system programming. Java emphasizes ease of use and accessibility, lacking certain features like multiple inheritance and pointers, whereas C++ supports these features and is closer to hardware. Additionally, Java has built-in thread support and virtual methods by default, while C++ relies on third-party libraries for thread support and has separate inheritance trees.

Uploaded by

atul
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

Difference Between Java and C++

Now, it’s high time to understand Java vs C++ in depth to clear all your doubts.

Basis Java C++

Platform Java code can run on any system with Java


C++ is platform-dependent.
Independence installed.

It is commonly used for application


programming, including Windows-based, C++ is primarily used for system
Main Usage
web-based, enterprise, and mobile programming.
applications.

Programming Language – Java started as a


C++ was designed for systems and
printer interpreter but evolved for
Design Goals applications programming,
network computing, aiming for ease of use
extending from C.
and accessibility.

It doesn't support goto, multiple C++ supports the goto statement,


Language inheritance (directly), operator multiple inheritance, operator
Features overloading, pointers (publicly), structures, overloading, pointers, structures,
or unions. and unions.

Java is compiled into bytecode and


Compiler and C++ is compiled only, leading to
interpreted, making it platform-
Interpreter platform dependency.
independent.

This language is less interactive with


Hardware
hardware. As a result, it focuses more on C++ is closer to hardware.
Interaction
software development.

Function C++ supports both call-by-value and


It supports call-by-value only.
Handling call-by-reference.

C++ creates separate inheritance


Inheritance and Java uses a single inheritance tree. In
trees. Moreover, C++ uses the
Virtual addition, Java methods are virtual by
virtual keyword for method
Methods default.
overriding.
Thread Support C++ relies on third-party libraries
It has built-in thread support and supports
and for thread support and lacks
documentation comments.
Documentation documentation comments.

You might also like