i dont know Java but i heard its pretty similar to C# and i know that so heres my attempt
class Program
{
public static void Main(string[] args)
{
int[] arr=new int[5];
for(int i=0; i<arr.length; i++) //input loop
{
arr[i]=int.Parse(Console.ReadLine());
}
for(int i=0; i<arr.length; i++) //output loop
{
System.Console.Write(arr[i]);
if(i=arr.length-1)
break;
System.Console.Write(", ");
}
}
}