Sir i am trying to print array's 0th element but i can't. Here is my code
import java.util.Scanner;
public class prog3
{
public static void main (String[] args){
Scanner input = new Scanner(System.in);
int size = input.nextInt();
String arr[] = new String[size];
for (int i=0; i<size; i++){
arr[i]= input.nextLine();
}
System.out.print(arr[0]);
}
}
when i am trying to print arr[0]
its return blank but when i print arr[1]
it returns the 0th element value. would you please help me to find my error.