Java instructions wrong

The image shows three rectangle:

Blue - instruction given by codecademy
Yellow - The same instruction applied by me
Red - The output result not coming as per shown in Blue Rectangle

When I search online for solution the code is missing one line which is while printing out onlyPrime array it needs to be stored in ArrayList for the expected output to be in array format

solution:

ArrayList primeNumbers = pd.onlyPrime(numbers);
System.out.println("Prime numbers: " + primeNumbers);

“PLEASE LOOK INTO THIS AND LET ME KNOW IF ANYONE OF YOU HAS FACE THIS ERROR OR AM I DOING SOMETHING WRONG”

It looks like you named the method onlyPrime instead of onlyPrimes

If you want to print an array, you could also use Arrays.toString
but you’d need
import java.util.Arrays;
or something similar
and
you could then do
System.out.println( Arrays.toString(pd.onlyPrimes(numbers)) );