CIS 35A: Introduction to Java Programming

Home | Green Sheet | Lectures | Assignments | FAQ

Introduction

Introduction
The main() method

public static void main (String[] args) {
...
}

The main() method is where the program starts running.

No matter how big the program is (in other words, no matter how many classes the program uses), there's got to be a main() method to get the ball rolling.

Running a program means telling the JVM to load the class and start executing its main(). Keep running until all the statements in the main are finished executing.

The main() method is where the program starts running.

Introduction | History | How does Java work? | What you'll do in Java? | Code structure in Java | Anatomy of a class | The main() method