That's because you are looking at trivial examples: every Java application must contain a main method whose signature looks like this:
public static void main(String[] args)
It is required to be
static
because its the starting point, and it is not associated with any object instance.
And once you get beyond "Hello World!" apps, the first thing most
main
functions do is create an instance of a class and start working with it. From that point on,
static
functions become rarer, the are only used in special cases.
public class Main {
public static void main(String[] args) {
System.out.println("Initializing...");
Main m = new Main();
m.Run();
}
public Main() {
}
public void Run(){
System.out.println("Running ...");
...
}
}
The Run method will create loads of instances of different classes to do what it requires.