/* Punters Lounge JAVA programming course * * Lesson31.java * * Required file/class : Scoreboard.class * * * Author : Erik Datapunter * Date : 28/apr/2004 * * Displays a football scoreboard. * */ public class Lesson31 { public static void main(String[] args) { // create a new Scoreboard object and name it Localgame Scoreboard Localgame = new Scoreboard(0,0); // fill the scoreboard with a game score Localgame.home = 1; Localgame.away = 2; // display the game score, being the state of the object System.out.println(Localgame.home); System.out.println(Localgame.away); // use the goals() method to determine Over or Under if (Localgame.goals() > 2) { System.out.println("Over"); } else { System.out.println("Under"); } } }