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
1.1 Why is primary goal of software development now shifting from
lidiya [134]

is where the term ‘App’ comes from. It is any piece of software that allows us to actually ‘use’ the computer. For example, it may be a word processor, web browser, spreadsheet software or even just a game. Application software relates to the user rather than the hardware

5 0
3 years ago
find all breweries that specialize in a particular beer style. A brewer is considered specialized if they produce at least 10 be
kolbaska11 [484]

Answer:

select style_name,br.name as brewery,count(beer_id) as Num

from beerdb.beers be  

inner join beerdb.styles st

on be.style_id = st.style_id

join beerdb.breweries br on  

be.brewery_id = br.brewery_id

group by style_name , br.name  

having count(beer_id)>=10

order by style_name, num desc

Explanation:

7 0
2 years ago
while investigating the settings on your SOHO router, you find two IP address reported on the devices's routing table, which is
DochEvi [55]

Answer:

From the two IP addresses, 192.168.2.1 can be listed as the default gateway in local network devices.

The reason is that we are allocated with the ranges that are reserved for the local networks by RFC 1918.

These ranges are given as follows:

  • For (10/8 prefix)  

                            10.0.0.0 - 10.255.255.255

  • (172.16/12 prefix)

                            172.16.0.0 - 172.31.255.255

  • (192.168/16 prefix)

                            192.168.0.0 - 192.168.255.255

Moreover the default gateway for a device can also be known by the commands ipconfig or  ipconfig/all on the command prompt.

<h3>I hope it will help you!</h3>
7 0
2 years ago
Which of the following is a benefit of a digital network?
k0ka [10]

Answer:

Multiple devices can be connected

8 0
2 years ago
The best way to share criticism is to ______. a. write it in the break room b. talk it about with all your coworkers c. talk abo
ICE Princess25 [194]

Answer:

C.

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • A ________ pays out cash flows from a collection of assets in different tranches, with the highest-rated tranch paying out first
    8·1 answer
  • Who would be a member of the American Dental Association?
    10·1 answer
  • Assume that the classes listed in the Java Quick Reference have been imported where appropriate.
    8·2 answers
  • [ANSWER = BRAINLIEST] How to mark an answer as brainliest?
    13·2 answers
  • Please choose the correct option please tell fast​
    9·1 answer
  • What means the data is still saved even if you turn the computer off or unplug it?​
    5·1 answer
  • In dos operating system ,write a command to delete the directory as well as the files of the directory ''world'' on drive E.
    15·1 answer
  • Jiz<br>Active<br>2<br>3<br>- 2(7 - 15)<br>What is the value of<br>4​
    10·2 answers
  • Write a function sumOfMultiples, that inputs two integers - seed and cap. The function should return the sum of all the multiple
    6·1 answer
  • How do you enlarge an image to see more detail on it? (1 point)
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!