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 ...

Introduction to HTML

Introduction to HTML HTML was first created by Tim Berners-Lee, Robert Cailliau, and others starting in 1989. It stands for Hyper Text Markup Language. HTML stands for HyperText Markup Language. It is used to design web pages using a markup language. HTML is the combination of Hypertext and Markup language. Hypertext defines the link between the web pages. A markup language is used to define the text document within tag which defines the structure of web pages. HTML stands for HyperText Markup Language. HTML is used to create web pages and web applications. HTML describes the structure of a Web page. HTML is widely used language on the web. HTML consists of a series of elements. HTML elements tell the browser how to display the content. We can create a static website by HTML only. Technically, HTML is a Markup language rather than a programming language. What You Can Do with HTML...? There are lot more things you can do with HTML. You can publish documents online with text, images, lis...