Skip to content

Instantly share code, notes, and snippets.

@stanwu
Created September 13, 2012 14:14
Show Gist options
  • Save stanwu/3714585 to your computer and use it in GitHub Desktop.
Save stanwu/3714585 to your computer and use it in GitHub Desktop.
HelloWorldApp class
/**
* The HelloWorldApp class implements an application that
* simply prints "Hello World!" to standard output.
*/
class HelloWorldApp {
public static void main(String[] args) {
System.out.println("Hello World!"); // Display the string.
changeCadence(10);
printStates();
}
static int cadence = 0;
static int speed = 0;
static int gear = 1;
static void changeCadence(int newValue) {
cadence = newValue;
}
static void printStates() {
System.out.println("cadence:" +
cadence + " speed:" +
speed + " gear:" + gear);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment