Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Classes
- These are what you will be coding. Think of classes as the blueprints for the object. They describe what the object contains and what it can do.
- Instance Variables
- These are the attributes of the object. For example, a Student object would have instance variables like name, GPA, and classification.
- Methods
- These are the actions that an object can make. To use the Student example, these could be things like getting the GPA or taking a class.
- Packages (1)
- Packages provide an organizational tool for Java projects by grouping similar classes together. A common naming convention is to use your domain backwards. As you can see, this project uses the Instructable domain. This helps to eliminate any issues when integrating Java programs. You may not run into this, but it is a good habit to get into.
- The two packages in this project are game and main. The game package contains the more backend information for running the game. The main package includes the class that interacts with the user.
- Classes (2)
- There are three classes in this project--Board, Player, an Runner. When deciding which classes need to be made for a project, think about the elements of what you're making. In this case, Tic Tac Toe only had two notable elements--a player to play the game and a board to play the game on. More complex programs will require more classes.
- Board
- This represents the Tic Tac Toe board. This class handles keeping track the of the state of the board and if the board is a winning board.
- Player
- This represents a player in Tic Tac Toe. It's a fairly simple class. It stores the player's name and it's playing symbol It also handles marking the board.
- Runner
- This class is what runs the program. We'll go into an overview in the next step.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement