Created
September 13, 2012 14:14
-
-
Save stanwu/3714585 to your computer and use it in GitHub Desktop.
HelloWorldApp class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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