Page 1 of 1

Write a method printBackwards that prints an array of integers in reverse order, in the following format. For example, i

Posted: Sun May 15, 2022 12:42 pm
by answerhappygod
Write A Method Printbackwards That Prints An Array Of Integers In Reverse Order In The Following Format For Example I 1
Write A Method Printbackwards That Prints An Array Of Integers In Reverse Order In The Following Format For Example I 1 (66.05 KiB) Viewed 63 times
Write a method printBackwards that prints an array of integers in reverse order, in the following format. For example, if the array is {1, -3, 4, 7, 2}, the method should print the following: element [4] is 2 element [3] is 7 element [2] is 4 element [1] is - 3 element [@] is 1 1 Full Screen 5 6 ArrayPrinting.java + New public class ArrayPrinting { public static void main(String[] args) { int[][] testList { {1, 2, 3}, {1, 2, 3, 4}, {1, 2, 3, 5, 6}, {1, 2, 3, 5, 999, -1, 67, 55, 220, 77}, {71, 89, -54, 771, 8921, 11}, }; 8 9 10 11 12- 13 for (int[] numbers : testlist) { System.out.println(" printBackwards (numbers); } // Do not touch the code above -- these are test cases, and how your method will be called with those test cases } 15 16 17 18 19 20 // Just write your method below (no need to touch anything in the main method above)