You have to do two things: first get the array that returnVal() returns. This involves calling the method and assigning what it returns to a variable. There is no particular reason for that variable to be called
x although it can be.
Secondly you print the element of the array you are interested in.
These two steps would be:
public static void main(String[] args) {
int[] arr = returnVal();
System.out.println(arr[2]);
}
"int[] arr" and "int arr[]" mean the same thing, but I think the former is clearer: whether declaring variables, method arguments, or the return type of methods (where I don't think I have ever seen the other form used).
These steps can be combined if that's sensible:
public static void main(String[] args) {
System.out.println(returnVal()[2]);
}