Question: in java, please Instructions you will be taking the . java file I have provided and will be implementing the two methods I have setup
in java, please
Instructions you will be taking the java file I have provided and will be implementing the two methods I have setup
Part One:
Method :
public static void convertArrayToFilechar array, String filename
This method should take the twodimensional array of characters passed in as well as the name of the file passed in It should then create a file containing the content of the twodimensional array of characters. Heres an example to clarify.
Example
Say we have the following array
char arrayhelloword
String filename Filetxt
Calling
convertArrayToFilearray filename results in the following
Filetxt containing
hello world
NOTE RUNNING THIS MULTIPLE TIMES MAY RESULT IN EXTRA CONTENT IN FILE BE SURE TO CLEAR THE CONTENT OF FILE BETWEEN EACH RUN OF METHOD
Method :
public static char convertFileToArrayString filename
This method should take a String filename as input. It should then read the content of the file and then create a twodimensional array of characters based on that content. Heres an example to clarify.
Example
Say we have the following File Filetxt
Filetxt contains
This is a word
Calling
convertFileToArrayFiletxt results in the following
thisisaword
This the code given
public static void convertArrayToFilechar array, String filename throws FileNotFoundException
Start code here
End code here
public static char convertFileToArrayString filenamethrows FileNotFoundException
Start code here
return null;
End code here
public static void printArraychar array
forint i; i
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
