C++ vs. Java (programming language)

Related Comparisons

Edit this comparison chart


User Rating (280):

Java (programming language)

Designed by Bjarne Stroustrup James Gosling and Sun Microsystems
Typing Discipline static, strong, 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
Paradigms Multi-paradigm, object-oriented programming, generic programming, procedural programming, functional programming, metaprogramming Multi-paradigm: object-oriented, structured, imperative, generic, reflective, concurrent
Appeared in 1985 1995
Major Implementations GNU Compiler Collection, Microsoft Visual C++, Borland C++ Builder, Intel C++ Compiler, LLVM/Clang OpenJDK, many others
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
Garbage Collection No Yes
Usual filename extensions .cc, .cpp, .cxx, .h, .hh, .hpp .java, .class, .jar, .war
Object-oriented Yes Yes
Programming-include include import
Generic Programming Yes Yes
Speed +-5% when compare with C if you know how to make a good use of C++.The performance of C++ and C are equal, since compilers are mature. slower than C++
Procedural Programming Yes Yes
Functional Programming Partial No
Statement terminators ; ;
Metaprogramming Yes No
Reflection No Yes
code compiled to native binary executable files compiled to bytecode
Runs on native OS Virtual machine
Inline comments delimiter // //
Block comments delimiter /* and */ /* and */
Multidimensional arrays supported Yes Yes
Arrays dynamically sized No No
Platform Any that has a compiler Mac, Windows, Linux, Android; any platform that supports JVM

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

Follow Diffen
Top 5 Comparisons
Make Diffen Smarter.

Log in to edit comparisons or create new comparisons in your area of expertise!

Sign up »