C++ vs Java

Comparison chart

 
Improve this chart C++

Rating: 3.9/5 (167 votes)

Java

Rating: 3.5/5 (13 votes)

Classes: Non POD or POD Yes
Programming-String type: Can use std::string or design a string by user Built in string class
Major Implementations: GNU Compiler Collection, Microsoft Visual C++, Borland C++ Builder Sun/Oracle, OpenJDK.
Statement terminators: ; Semicolon terminated
Inline comments delimiter: // //
Typing Discipline: Static, Unsafe, Nominative static, strong, safe, nominative, manifest
Influenced: Ada 95, C#, Java, PHP, D, Aikido Ada 2005, BeanShell, C#, Clojure, D, ECMAScript, Groovy, J#, JavaScript, PHP, Python, Scala, Seed7, Vala
Programming-input /output: cin for input;cout for output, also support scanf for input;printf for output.Whatever, cin and cout are slower than printf or scanf most of the time, ditch it when it become your bottleneck System.out.println("");
Designed by: Bjarne Stroustrup James Gosling and Sun Microsystems
Programming-include: use #include <iostream> import x.y.z;
OOP(Object Oriented Programming): Yes-polymorphism and inheritance, Classes. Yes, single inheritance.
Garbage Collection: Manual, you could manage the memory as C did, or use smart pointer , destructor to provide better and safer mechanism.According to your implementation, smart pointer can be zero runtime impact Yes
Appeared in: 1985 1995
Influenced by: C, Simula, Ada 83, ALGOL 68, CLU, ML Ada 83, C++, C#, Eiffel, Generic Java, Mesa, Modula-3, Oberon, Objective-C, UCSD Pascal, Smalltalk
Usual filename extensions: .cc, .cpp, .hh, .hpp .java, .class, .jar

Add content for C++ vs. Java or review and improve the comparison table above.

Related Articles


Comments: C++ vs Java

Search for a comparison
Mail