ΠΠ΅Π±-ΡΠ°Π·ΡΠ°Π±ΠΎΡΠΊΠ°. Π Π°Π·ΡΠ°Π±ΠΎΡΠΊΠ° Ρ Π½ΡΠ»Ρ. Π―Π·ΡΠΊ ΠΏΡΠΎΠ³ΡΠ°ΠΌΠΌΠΈΡΠΎΠ²Π°Π½ΠΈΡ - Java. Π‘Π΄Π΅Π»Π°ΡΡ ΡΠ½ΠΈΠ²Π΅ΡΡΠΈΡΠ΅ΡΡΠΊΠΎΠ΅ Π·Π°Π΄Π°Π½ΠΈΠ΅. In a class named StringMethods, implement each of the methods described below: a static method called printEveryOther that takes a String as its parameter and prints every other character of the string β i.e., the first character, the third character, etc. For example, a call of printEveryOther(“method“) should produce the following outpu : mto This method should not return a value. Hint: You may find it helpful to use a for loop as part of your implementation of this method. In addition, you will need to use one or more of the String methods that we discussed in lecture. a static method called longerLength that takes two String objects as parameters and returns the length of the longer of the two strings. If the two strings have the same length, you should return that length. For example: a call of longerLength(“bye“, “hello“) should return 5, because 5 is the length of “hello“, which is the longer of the two strings. a call of longerLength(“goodbye“, “hi“) should return 7, because 7 is the length of “goodbye“, which is the longer of the two strings. This method should not do any printing; rather, it should determine the longer length and return it. Hint: You should use conditional execution (i.e., an if-else statement) to determine which length to return. a static method called secondIndexOf that takes as its two parameters a string str and a character ch and returns the index of the second occurrence of ch in str. For example: a call of secondIndexOf(“banana“, 'a') should return 3, because the second occurrence of 'a' in “banana“ occurs at position 3 in the string a call of secondIndexOf(“banana“, 'n') should return 4, because the second occurrence of 'n' in “banana“ occurs at position 4 in the string. You may assume that the string passed in as the first parameter has at least two occurrences of the character passed in as the second parameter. This method should not do any printing; rather, it should return the appropriate integer. a static method called lastNChars that takes as its two parameters a string str and an integer n, and that returns a string consisting of the last n characters of str. For example: a call of lastNChars(“programming“, 5) should return the string “mming“ a call of lastNChars(“programming“, 1) should return the string “g“. You may assume that the value of n is positive. This method should not do any printing. Rather, it should extract the appropriate string and return it. Special case: If the value of n is greater than the length of the string, the method should return the entire string. For example, a call of lastNChars(“programming“, 15) should return the string “programming“. You should use conditional execution to allow your method to handle this special case. Test your code using the following methods' calls: System.out.println(“** part 1 **“); printEveryOther(“method“); System.out.println(); System.out.println(“** part 2 **“); int len = longerLength(“bye“, “hello“); System.out.println(len); System.out.println(); System.out.println(“** part 3, example 1 **“); int index1 = secondIndexOf(“banana“, 'a'); System.out.println(index1); System.out.println(); System.out.println(“** part 3, example 2 **“); int index2 = secondIndexOf(“banana“, 'n'); System.out.println(index2); System.out.println(“** part 4, example 1 **“); String lastN = lastNChars(“programming“, 5); System.out.println(lastN); System.out.println(“** part 4, example 2 **“); lastN = lastNChars(“programming“, 1); System.out.println(lastN); System.out.println();