Question: public class File_In_36 { private String filename; public int[][] matrix() { // 1. matrix will call scan_File to determine whether or not the file //
public class File_In_36
{
private String filename;
public int[][] matrix()
{
// 1. matrix will call scan_File to determine whether or not the file
// name entered by the user actually exists
// 2. matrix will call size_matrix to determine the number of integers
// in the input file and set the instance variable matrix_size to that
// number
// 3. matrix will call check_square to determine whether or not matrix_size
// has the exact number of integers required for a square matrix
// {4, 9, 16, 25, 36 ...}
// 4. If the matrix is square, method matrix will call form_matix and return
// a reference to a two dimensional square array; else it will return null
System.out.println("The filename passed to matrix = " + filename);
int[][] dummy = new int[4][4];
return dummy;
}
}
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
