Java Tutorial Lesson 05: Method arguments
From Erlands Wiki
You have a “Game” class that looks as follows:
public class Game { public static void main(String[] args) { System.out.println("Lesson 5"); System.out.println(); Room room = new Room(1); room.print(); } }
Your job is to create the Room class.
When starting the program with:
java Game
It should give the output:
Lesson 5 ---------- | | | 1 | | | ----------
Some optional things to try:
- Try change the main class so a random number is printed in the box instead of the hardcoded 1
- Try to update the Room class so it looks good even if the number is more than one digit
- Try to update the Room class and Game class so it can write a custom text string instead of a digit
