1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
skad [1K]
3 years ago
9

Create a TicTacToe class that initializes a 3x3 board of "-" values. We will use this class in future exercises to fully build o

ut a Tic Tac Toe game! The TicTacToe class should have a 2D array as an instance variable and a constructor that initializes the 2D array with the "-" value. Add a getter method that returns the private 2D instance variable.
Computers and Technology
1 answer:
kap26 [50]3 years ago
8 0

Answer:

public class TicTacToe //Defining TicTacToe class

{

char board[3][3] ; //Creating a 2D array instance variable

TicTacToe() //Constructor to initialize the array with " - "

{

for( int i = 0;i<3;i++) //Loop for the row of array

{

for(int j = 0;j<3;j++) //Loop for the column of array

{

Board[i][j] = '-'; //Assigning "-" in each cell

}

}

}

public char getter() //Defining getter() method to return the array

{

return Board; //returning the array

}

}

You might be interested in
If she presses the left arrow , what will happened
Harman [31]
The keyboard will move
4 0
3 years ago
How is peace circulated?​
Agata [3.3K]

Answer:

Peace is when people are able to resolve their conflicts without violence and can work together to improve the quality of their lives. 

6 0
3 years ago
Read 2 more answers
The option to add the date and time to a document is located in the
Tomtit [17]

Answer:

The option to add the date and time to a document is located in the

text grouping on the Insert tab.

Explanation:

8 0
3 years ago
Read 2 more answers
Your client noticed that his ad was disapproved for editorial reasons. Why is it important for him to understand and abide by Go
astra-53 [7]

Answer: Ad Words policies can help ensure ads are useful, varied, relevant, and safe for web users

Explanation: Google Ads do have a policy for the ad display which requires that the ads should be secured, relevant and safe for the users on the web. Google Ads positively review every Ads that is created or has been changed in some terms as their policy. It maintains the standard and relevancy on the web and no objectionable content gets posted .

This might be the reason that the client's ads are disapproved because he/she is not aware of the Google's ads policies.

3 0
3 years ago
What is the definition of physical fitness?
Bond [772]
The answer is A:the body’s ability to be efficient during movement.
5 0
3 years ago
Read 2 more answers
Other questions:
  • Twitter is an example of a __________. social bookmarking website social tagging website microblogging website blogging website
    12·1 answer
  • In modern computer memory, each location is normally composed of one byte.
    7·1 answer
  • Question 1 (1 point)
    10·2 answers
  • A Network Attached Storage device is good for _____.
    11·2 answers
  • All of these acts performed when doing an oil and filter change except ?
    9·2 answers
  • What malware looks like a useful or desired executable program but is, in reality, a program that is supposed to cause harm to y
    11·1 answer
  • Please help im not good at computer class ​
    10·2 answers
  • Why media is far from government​
    6·2 answers
  • Owen is writing a program that will lock his computer for one hour if the incorrect password is entered more than five times. Ha
    14·1 answer
  • I watched an ad but the im button done is no where in sight, has anyone else experienced this recently. it was fine a few days a
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!