Please help help me with the following question in Java. Thanks
Write a public member method that takes an array of integer (int) values and prints all the prime number values to the screen. You may assume the array is filled with values.
import java.util.*;
class Test
{
public static void findprime(int arr[])
{
for(int
i=0;i<arr.length;i++)
{
for(int
j=2;j<=arr[i];j++)
{
if(arr[i]%j==0 && arr[i]==j)
System.out.print(arr[i]+" ");
if(arr[i]%j==0 && arr[i]!=j)
break;
}
}
}
public static void main (String[] args)
{
int k;
Scanner sc=new
Scanner(System.in);
System.out.println("enter array
size : ");
int n=sc.nextInt();
int [] arr=new int[n];
System.out.println("enter array
elements : ");
for(int i=0;i<n;i++)
{
k=sc.nextInt();
arr[i]=k;
}
System.out.print("prime number :
");
findprime(arr);
}
}
// OUTPUT

// If any doubt please comment
Please help help me with the following question in Java. Thanks Write a public member method...