Skip to main content

Difference Between C++ and Java

Difference Between C++ and Java

 We read the difference between step by step C ++ and Java, if you have any doubt, you can comment in the comment box below and clear your case from me.


Object Oriented Programming in C++ and Java

  • C ++ is not a completely object oriented programming language because in it we can also create programs without classes and objects.
  • On the other hand, if we talk about Java, then it is a Purely Object Oriented Programming language, because in it we cannot create any new program without classes and objects.

Difference Between Platform Dependent and Platform  Independent in Java and C++

  • C ++ is a platform dependent programming language because it cannot run code written in one computer into another computer.
  • The same Java is a kind of Platform Independent programming language because we can run its byte code easily in any computer.

Operator Overloading in C++ and Java

  • C ++ »Language Operator supports overloading.
  • Java »Language operator does not support overloading.

Compiler and Interpreter Difference

  • Only compiler is used in C ++, this means that the program code in C ++ language is converted from source code to machine code by compiler.
  • On the other hand, if we talk about Java - Java uses both Language Compiler and Interpreter.

First java program code (source code) is converted into byte code by the compiler, then the interpreter then converts that byte code into machine code which is executed in the machine.

Multiple Inheritance in Java and C++

  • C ++ programming language supports multiple inheritance.
  • The same Java language class does not support multiple inheritance.
(Multiple Inheritance in Java language is applied through Interface.)

Pointer in C++ and Java

  • In C ++ programming language you can write and create program code using Pointer.
  • Pointer in java language supports internally, and friends, let me tell you that today we cannot write in java language separately using pointer program.

Structure and Union Difference in C++ and Java

  • The C ++ programming language supports the structure and union concept.
  • Java programming language does not support the concept of structure and union.

Memory Allocation and Deallocation in C++ and Java

  • The responsibility of allocating and deallocate memory in C ++ language is of the programmer.
  • Memory management in Java is done by JVM, which means memory allocate and deallocate automatic in it.

Access Specifier in Java and C++

  • C ++ has three access specifiers:
  1. Public
  2. Private
  3. Protected
  • The same Java has four Access specifiers:
  1. Public
  2. Private
  3. Protected
  4. Default

Header file

  • The concept of Header File is available in C ++.
  • The concept of header file is not available in Java, it has a package instead of header file. 

Virtual Keyword in Java and C++

  • Whether or not to over ride the method in C ++, Virtual Keyword is available meaning that C ++ supports virtual keyword.
  • Virtual Keyword is not available in Java, in this we can over-ride all non-static method by default. (Non-static methods by default is virtual.)

Call by value and Call by reference in Java and C++

  • C ++ has both call by value and call by reference support.
  • Supports only call by value in Java.

Destructor in C++ and Java

  • C ++ supports Destructor which works to destroy memory.
  • Java does not support Destructor because it has automatic garbage collection available.



Comments

Popular posts from this blog

Features of Android

 Features of Android let's see the features of android. The important features of android are given below: Beautiful UI :- Android operating system provides a UI which is associated with the activity and presented to user. Connectivity  :- It has various connections such as Bluetooth, Wi-Fi, GSM/EDGE, CDMA etc. Storage :- A light relational database – SQLite is used for the storage purpose. Media support  :- H.263, H.264, MPEG-4 SP, AMR, AMR-WB, AAC, HE-AAC, AAC 5.1, MP3, MIDI, Ogg Vorbis, WAV, JPEG, PNG, GIF, and BMP. Messaging  :- It supports messaging services -SMS , MMS. GCM  :- Google Cloud Messaging (GCM) is a service that lets developers send short message data to their users on Android devices, without needing a proprietary sync solution. Web Browser  :- It is based on the open-source WebKit layout engine which is coupled with Chrome’s V8 JavaScript engine that supports HTML5 and CSS3. Resizable widgets  :- Widgets are resizable, so user...

Features of Java | Why To Learn Java Programming

Features of Java | object-oriented features of java The main reason behind the creation of Java was to bring portability and security features to the computer language. Apart from these two salient features, there were several other features which played an important role in shaping the final form of this excellent language. The most important features of Java language are given below: 1:- Object Oriented:- In Java , Everything is an Object. Clear Structure for the programs Faster and easier to execute. Java can be extended easily because it is based on the object model. 2:- Platform Independent:- Java is a platform independent language, which means that compiled code Java can run in all operating systems. 3:- Easy to learn:-   If you understand the basics of the OOP concept, Java programming is quite easy to learn. 4:- Secure:- Java is more secure in compression of all programming languages, and with Java's secure feature, it is capable of developing virus-free, tamper-free ...

Java JRE and JVM | Difference between JVM and JRE

 Java JRE and JVM | Difference between JVM and JRE In this topic, we will give you complete information of JRE and JVM. JVM(Java Virtual Machine) JVM (Java Virtual Machine) is an abstract machine that enables your computer to run Java programs. and Which provides a runtime environment. When you compile a java program, it is converted into byte code. This byte code cannot run on any machine or operating system. It only runs on JVM (Java Virtual Machine). The Java Compiler that Byte Code generates is for JVM because of the JVM being in the entire system, this program runs in every computer, making the Virtual Machine Code running in the Operating System. JRE(Java Runtime Environment) The full name of JRE is Java runtime environment. JRE is also called java runtime. JRE is a part of JDK (java development kit). JRE is a group of software tools to develop Java applications. The JRE class contains groups of libraries and other files, which JVM uses in runtime and it also contains JV...