Java and Python are high-level programming languages that are very different. Python appeared earlier than Java, as it appeared in 1991 while Java appeared in 1995. Java and Python handle variables differently. Java codes are longer than Python codes.

Comparison chart

Java versus Python (programming language) comparison chart
Edit this comparison chartJavaPython (programming language)
Designed by James Gosling and Sun Microsystems Guido van Rossum
Major Implementations OpenJDK, many others CPython, PyPy, IronPython, Jython
Typing Discipline Static, strong, safe, nominative, manifest Dynamic, strong
Influenced by Ada 83, C++, C#, Eiffel, Generic Java, Mesa, Modula-3, Oberon, Objective-C, UCSD Pascal, Smalltalk Perl, ABC, ALGOL 68, C, C++, Dylan, Haskell, Icon, Java, Lisp, Modula-3
Statement terminators Semicolon terminated Newline terminated
Introduction (from Wikipedia) Java is a computer programming language that is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. Python is a widely used general-purpose, high-level programming language. Its design philosophy emphasizes code readability, and its syntax allows programmers to express concepts in fewer lines of code than would be possible in languages such as C.
Inline comments delimiter // #
Block comments delimiter /* and */ Triple quotes
Multidimensional arrays supported Yes Yes
Appeared in 1995 1991
Influenced Ada 2005, BeanShell, C#, Clojure, D, ECMAScript, Groovy, J#, Javascript, PHP, Python, Scala, Seed7, Vala Boo, Cobra, D, F#, Falcon, Go, Groovy, JavaScript, Ruby
OS Cross-platform Cross-platform
Arrays dynamically sized No Yes
Garbage Collection Yes Yes
Programming-include import import
Stable release Java Standard Edition 8 (1.8) / March 18, 2014 3.4.0 / 16 March 2014; 2.7.6 / 10 November 2013
Paradigms Multi-paradigm: object-oriented, structured, imperative, generic, reflective, concurrent Multi-paradigm: object-oriented, imperative, functional, procedural, reflective
Speed slower than C++ Not too shabby. When using like it was intended, as structuring glue, to call speedy code, often written in C, it's speedy enough.
Language design goals Interoperability Easy, powerful, short development times
Developed by Oracle Corporation Python Software Foundation
Dialects Generic Java, Pizza Cython, RPython, Stackless Python
OOP (object-oriented programming) Yes Yes
Memory management Automatic Automatic
Single-line comment delimiter // #
Type Compiled Interpreted
License GNU General Public License, Java Community Process Python Software Foundation License
Filename extension(s) .java , .class, .jar .py, .pyw, .pyc, .pyo, .pyd

Typing discipline

Java is statically typed, and so it forces a computer programmer to define the type of a variable when he first declare it and will not allow him to change the type later in the program. Python is dynamically typed and a programmer can just use his variables as he wants to without worrying too much about their types.

Code separation

Kasia Mikoluk says that Python is unusual among programming languages in that it uses indentation to separate code into blocks, while Java uses curly braces to define the beginning and end of each function and class definition. The advantage of using indentation is that it forces the programmer to set his program out in a way that is easy to read, and there is no chance of errors resulting from a missing brace.

Code length

Larry Wall says that Java codes are heavyweight and verbose. The Python website says that Python codes are 3-5 times shorter than Java codes.

Ease of use

Python is easier to use than Java because its code is shorter and the programming language is dynamically typed.


Share this comparison:

If you read this far, you should follow us:

"Java vs Python." Diffen LLC, n.d. Web. 19 Apr 2018. < >