Q) Display the contents of an array
public class ArrayDisplaySample { public void showArray (int [] sampleArray){ for(int i=0; i<sampleArray.length; i++){ //running a loop through the length of the array System.out.println(sampleArray[i]); //printing each element } } }