• You need Scanner to import data from the outside
  • Private allows only the method (current class) to use the variable inside it, and does not allow any other class to use the variable. (Isolated to current class)
  • Methods are Functions

In Java, everything begins with the class. No class, no java.


  • public means that main() can be called from anywhere
  • static means that main() doesn’t belong to a specific object
  • void means that main() returns no value
  • main is the name of a function. main() is special because it is the start of the program
  • String[] means an array of String

args is the name of the String[] (within the body of main()) args is not special; you could name it anything else and the program would work the same.


  • import java.util.Scanner: You need to import the tools that you want to use; java only uses the things it needs.
Advertisements