Question

Write the line that declares a two-dimensional array of strings named chessboard. That is, how would...

Write the line that declares a two-dimensional array of strings named chessboard. That is, how would I declare a two-dimension array of strings that is called chessboard? You would declare a String array by saying " String []" correct? Now that's just a single array. How can I make that a two-dimension array? And how would I name it chessboard?

Write the line that declare and creates a two-dimensional array of chars, tictactoe, with 3 rows, each with 3 elements , and initialize it to all space characters.

Write the line that declares and instantiates a 8x8 two-dimensional array of strings named chessboard.

A 2-dimensional 3x3 array of ints , has been created and assigned to tictactoe. Write an expression whose value is that of the first element in the last row (See topic 8.2, page 289 - this solution could be of simply one line.)

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Declare a two-dimensional array of strings named chessboard.
String [][] chessboard;

Write a statement that instantiates an 8x8 array of strings and assign it to chessboard.
chessboard = new String[8][8];

Declare and create a two-dimensional array of chars, tictactoe, with 3 rows, each with 3 elements, and initialize it to all space characters.
char[][] tictactoe = {{' ',' ',' '},{' ',' ',' '},{' ',' ',' '}}


A 2-dimensional 3x3 array of ints, has been created and assigned to tictactoe. Write an expression whose value is that of the first element in the last row.
tictactoe[2][0]

Add a comment
Know the answer?
Add Answer to:
Write the line that declares a two-dimensional array of strings named chessboard. That is, how would...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT