Lecture 2: Java vs. Python

Today, we’ll learn more about Java by comparing it to what we already know about Python.

[lecture video]

What’s going on behind the IDE?

  • You can run Python in the interpreter…but not Java programs
  • Java is compiled
  • running Java programs from the command line

What we need for a Java program

  • Every Java program must define a class, and all code is inside a class
  • Everything in Java must have a type
  • Every Java program must have a function called ‘public static void main(String[] args)’