Question: Notice the already-defined instance data, row, an array of int values. Do not add any instance data to the class. Overloaded constructor (2nd one in
- Notice the already-defined instance data, row, an array of int values. Do not add any instance data to the class.
- Overloaded constructor (2nd one in code skeleton) which initializes the array to a random set of 0s and 1s. Array is of the provided size (passed in as parameter).
- Complete the default constructor (1st one in code skeleton) which initializes the array to a random set of 0s and 1s with a default array size of 5.
- Complete the last overloaded constructor (3rd in code skeleton) which initializes the instance data array to the array passed as a parameter.
- The toString() method is already defined.
- Write a method getRowClues() which returns a String counting the number of sequential 1s.
package rowcluesproject;
public class PuzzleRow { private int[] row; public PuzzleRow () { } public PuzzleRow (int size) {
} public PuzzleRow (int[] row) {
} public String toString() { String result = ""; for (int i=0; i }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
