Basic Classes & Methods

File name

Note: the file name needs to be the same as the class that it contains

example: ClassName.java

Create a class

public class HelloWorld 
{
	// code for the class goes here
}

Methods

Note: every java program must have a method called main

// inside the HelloWorld class

public static void main(String[] args) 
// args contains arguments passed in by the terminal, they can be accessed args[0]
{
	// main code goes here 
}

Passing in args

java FileName argument1 argument2