Friday, 30 October 2020

Difference between C++ and JAVA

 

 

 

Difference between C++  and  JAVA 




JAVA 

1. Java is  true Object-Oriented language.

 

2. Java does not support  operator  overloading .

3. It supports lables  with  loops  and  statement     blocks.

 

4. Java does not have template classes  as in C++.

 

5. Java compiled into byte code  for  the  java virtual machine . The  source code  is  independent on operating system .

 

6. Java does not  support multiple  inheritance of classes  but it supports  interface.

 

7.Runs in a  protected  virtual machine .


8. Java  does  not  support  global variable variable .Every variable should declare in class.


9. Java does not use pointe.


10.  It Strictly  enforces an object oriented programming  paradiam.


11. There  are no  header  files in java.


12. De - allocation  of memory  will be take  care of  by JVM.


13. Java supports  4 access specifiers : Private ,Public, Protected and  Deault.


14. Only  constructors are  there  in java .  No  destructors  are available.



             DIFFERENCE

                     

 

 

C++

 

1. C++ is basically C with Object -Oriented extension.

2. C++ supports operator overloading .

 

3. It supports goto  statement .

 

4.  C++ has template classes.

 

5. Source code  can be written to be  plateform  independent and  written to  take  advantage  of  platform . C++  typically compiled into machine code.


6. C++ supports  multiple inheritance of  classes.


7. Exposes low -level system  facilities.


8. C++  support global  variable.


9. C++  uses  pointer . 

 

10.  It allow  both  procedural programming  and  object - oriented  programming .

 

11. We have to use header  file  in C++.

 

12.  De -allocating  memory  is the  responsibility of  the  programmer.

 

13. There are 3  access  specifiers in C++ : Private , Public   and Protected.

 

14. There are  constructors and deconstructors in C++. 

 

 

 

 

 

Thank you 💖

 

No comments:

Post a Comment

Student Marks Calculation app using java

      import javax.swing. *; import java.awt.event.ActionEvent ; import java.awt.event.ActionListener ; public class Student { private J...