PYTHON VS. JAVA: DYNAMIC VS. STATIC
In Python, typing is determined dynamically, at runtime In Java, typing is determined statically, at compile-time: This means every variable must be rst declared with a particular type, and you're not supposed to change the type afterwards.
In Python, this works ne. The above Java source code will fail to compile!
# Python x = 3 # x is an integer 3 x = “Hello World!” # x is now a string int x = 3; System.out.println(x); // So far so good x = “Hello, world!” // Above line is not allowed! System.out.println(x);
1 / 6