- Array with predefined length
import java.util.Scanner;
public class ab
{
public static void main(String [] args)
{
Scanner a = new Scanner(System.in);
int [] arr = new int[4];
//input
System.out.println("Enter array values");
for(int i = 0;i<=3;i++)
{
arr[i]=a.nextInt();
}
//
System.out.println("Output is");
for(int i=0;i<=3;i++)
{
System.out.print(arr[i]);
}
}
}