Hey. I’m new to the forums so I’m learning as I go. I just finished my Codecademy Java course and I want to practice until more lessons are added. I want to create a tic-tac-toe game using Android Studio, but I’m having problems on when should I create new packages and classes. If anyone can help me, I would greatly appreciate it.
A class is a declaration (and often implementation) which encapsulates the members properties and methods which instances of that type will posses. You can create instances of a class as distinct, individual objects that behave as specified.
Should my projects include multiple packages then?
You can store classes that are doing related things in one package. Like if you have a class that’s displaying the board and one that’s updating it, they should be in the same package.
So for my game, I need to have a class for the board, one for updating, one for the Xs, and one for the circles. Right?
Yes, that’s totally fine if they’re in the same package / file