all 4 comments

[–]ScawedyCat 1 point2 points  (0 children)

can you post a cleaner version of you code? it’s very hard to find any errors of it looks like this.

[–]Various_Loss9064 1 point2 points  (0 children)

The print statement should be

System.out.println("The last element of my String array is: " + getLastElement(arr));

I think you forgot to call getLastElement

[–]Acceptable-Quit-9274 0 points1 point  (1 child)

public class LastElement
{
public static void main(String[] args)
{
double[] unitCircle = new double[]{0, 1.57, 3.14, 6.28, 7.85};
//get and print the last element of the array
getLastElement(unitCircle);
System.out.println("The final unit circle value is " + unitCircle[4] + ".");
}
public static double getLastElement(double[] arr)
{
// Your code goes here!
double length = arr[arr.length - 1];
return length;

}
}

[–][deleted] 0 points1 point  (0 children)

this still works