1.

Java vs Python

Answer»

Both Java and Python are HIGH level languages. Some of the differences between these languages are given as follows:

JavaPython

Java has longer lines of code that are more complex as COMPARED to Python. For example:

public class Demo {   public static void main(String args[]) {     System.out.println(“Hello World”); }   }

Python has shorter and easier lines of code as compared to Java. For example:

print(““Hello World”)

The type of the variable that is used should be declared in Java.

There is no need to declare the type of variable in Python as it is dynamically typed. This is KNOWN as duck typing.

JVM is available almost everywhere because of the high portability of Java.

Python is also portable but it is not as popular as Java

Each statement in Java requires a semicolon at the end.

statements in Python do not require a semicolon at the end.

Java database connectivity is quite popular (JDBC) and so Java is frequently used with databases.

Python is not used with databases frequently as its database access layers are WEAKER than JDBC.

Java is more complicated to use than Python as there is no dynamic programming and the codes are also larger.

Python is easier to use than Java as dynamic programming is used and the codes are also shorter.

Java is faster than Python.

Python is slower than Java.

Curly braces are mandatory in Java to define a block.

Curly braces are not required in Python but indentation is mandatory.



Discussion

No Comment Found