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:
- Public
- Private
- Protected
- The same Java has four Access specifiers:
- Public
- Private
- Protected
- 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
Post a Comment
If you have any doubts, Please let me know