-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDifferenceCPPandJAVA.txt
48 lines (45 loc) · 3.09 KB
/
DifferenceCPPandJAVA.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
MAIN DIFFERENCES IN C++ and JAVA
----------------------------------
+---------------------------------------------------------------------+
| C++ | Java |
|----------------------------------|----------------------------------|
| Platform Dependent | Platform Independent |
| Write once Compile anywhere/WOCA | Write once run anywhere/ WORA |
|----------------------------------|----------------------------------|
| Runs on Native Executable | Runs on a Virtual Machine |
| Machine Code for target | |
| Instruction Set | |
|----------------------------------|----------------------------------|
| Procedural and Object Oriented | Pure Object Oriented Language |
| Language support | (supports scripting languages) |
|---------------------------------------------------------------------|
| Both supports functional, procedural, generic programming paradigms |
|---------------------------------------------------------------------|
| Supports Destructors, but no | Supports Automatic Garbage |
| Garbage collectors | Collection |
| | |
| Memory management can be done | |
| manually (new, delete) | |
| | |
| Supports Deterministic | Supports Non-Deterministic use |
| Destruction of Objects | of finalize() method |
|----------------------------------|----------------------------------|
| Pointers, references, | All types (primitive/ reference |
| pass-by-value are supported for | types) are always passed by |
| all types (primitives/ | value |
| user-defined) | |
|----------------------------------|----------------------------------|
| Supports Structures and Unions | No support for Struct and Union |
|----------------------------------|----------------------------------|
| Supports GOTO/ Jump statements | No GOTO statement, but has label |
| | which can be used only before |
| | nested loops |
|----------------------------------|----------------------------------|
| Operator Overloading | Operators NOT overridable |
|----------------------------------|----------------------------------|
| Single and MULTIPLE Inheritance | Single Inheritance of Classes |
| | Multiple Inheritance - Interface |
|----------------------------------|----------------------------------|
| No documentation mechanism | Extensive JavaDoc documentation |
| | standard for all classes |
+---------------------------------------------------------------------+