Question: In a class named ArrayMethods, write each of the methods described below. 0. Include the following class declaration at the beginning of your class: public
In a class named ArrayMethods, write each of the methods described below.

![public static final String[] DAYS = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday, "Friday",](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/01/65ba82fbc1a6a_04365ba82fb9acc6.jpg)



0. Include the following class declaration at the beginning of your class: public static final String[] DAYS = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday, "Friday", This array, declared at the class level, is a static final array of strings. Each element of this array reprsents a day of the week. Declaring this array static means it has class level scope and can be accessed by any method written in this class. We will only be using it in one of the methods. Declaring this array to be final means it is read only and cannot be modified. By convention, variables declared to be constant variables (i.e. final) are typically always in upper case. This way when you are looking through code and see a variable in all upper case, you should be able to assume that the variable is read only. 1. Write a method with the header public static void swap Adjacent (int [] values) that takes a reference to an array of integers values and swaps adjacent pairs of elements: values [0] with values [1], values [2] with values [3], etc. For example, after implementing this method and compiling your Array Methods class, you should see the following when you test the method programmatically: int[] a1 = {0, 2, 4, 6, 8, 10}; ArrayMethods. swapAdjacent(a1); System.out.println( Arrays.toString(a1) ); should output: [2, 0, 6, 4, 10, 8] In an odd-length array, the last element should not be moved:
Step by Step Solution
3.36 Rating (149 Votes )
There are 3 Steps involved in it
Create a class named ArrayMethods in which the implementation of different methods is to be done public class ArrayMethods public static final String DAYS Sunday Monday Tuesday Wednesday Thursday Frid... View full answer
Get step-by-step solutions from verified subject matter experts
