Question: 5 points Status: Not Submitted Write a method called get LastElement that returns the last element of the given array In the main method, call

5 points Status: Not Submitted Write a method called get LastElement that returns the last element of the given array In the main method, call the 'getLastElement method and print the results. Your output should be the following: The last element of the String array is: Karel Save 5.1.8: Last Element in Array public class LastElement { public static void main(String[] args) { String[] arr = new String[]{"hello", "my name", "world", "Karel"}; 1/get and print the last element of the array } public static String getLastElement(String[] arr) { System.out.println("The last element of the String array is: + getla 13} 1 2 63 arch O RI
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
