What will be the output of the following program?
public class Printstatment14
{
public static void Elements(int[] arr)
{
for (int i = 0; i < arr.length; i++)
{
boolean isValid = false;
for (int j = 0; j < i; j++)
{
if (arr[i] == arr[j])
{
isValid = true;
break;
}
}
if (!isValid)
{
System.out.print(arr[i] + " ");
}
}
}
public static void main(String a[])
{
int[] nums = {5, 2, 7, 2, 4, 7, 8, 2, 3};
Printstatment14.Elements(nums);
}
}