1. Write a method mycopy that creates a new array of int\'sof the same size as t
ID: 3614282 • Letter: 1
Question
1. Write a method mycopy that creates a new array of int'sof the same size as the parameter arr and contains a copyof the values in arr. The new array should bereturned.2. Write the method printMax. It must use aScanner to read integers from the file whose name ispassed as a String parameter, determine the maximum value read andreturn that maximum value.
3.Write code in the main method below that correctly declares andcreates a two dimensional array m with elementtype int and with 2 rows and 4 columns. Then write code toinitialize the array so that it has these values:
1 2 3 4 4 3 2 1
1 2 3 4 4 3 2 1
Explanation / Answer
please rate - thanks import java.util.*; import java.io.*; public class untitled { public static void main(String[] args) {int i,j; String filename="input.txt"; int a[]={1,2,3,4,5,6,7,8,9,10}; int[] b; int[][]m=new int[2][4]; b=mycopy(a); System.out.print("A: "); for(i=0;iRelated Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.