Difference Between C++ and Java | Difference Relation | Comparison | C++ vs Java


Java vs C++

There are so many differences between the C++ and Java. Among Them Some Are listed Below:-


Parameters C++ Java
Platform-independent C++ is Dependent Java is Independent
Inheritance C++ Supports all types of Inheritances Java Also Supports All types of Inheritance Except Multiple Inheritance Because od Ambigiuty
Input/Output Operation In C++ , For Input "Cin" is used and for output "Cout" is used In Java , For Input Scanner Class is used and For output "System.out.println(" ");" is used
Operator Overloading C++ supports operator overloading. Java doesn't support operator overloading.
Thread We Don't Used Thread In C++ We Used Thread in Java
Classes It is Not Necessary To Make Class to Run Program. In Java , It is necessory to make class otherwise program will not run.
Object Oeriented Programming It is Not Purely OOP. It is Purely OOP.
Destructor C++ Support Destructor. Java Dont't Support Destructor.


C++ Example

File: Demo.cpp

#include<iostream.h>

using namespace std;

Void main()
{
    cout << "Hello C++ Programming";
    getch();
}




Java Example

File: Demo1.java


class Demo1
{
    public static void main(String args[])
    {
       System.out.println("Hello Java");
    }
}



In This Article We Learned That Diiference between C++ and Java . If You Any Doubt Please Comment Me So that i can give you Answer.

Thank you.

Post a Comment

1 Comments

  1. Ty for this.... perfect given points...well done 👍👍👌👌

    ReplyDelete