I'm trying to scan a matix but I am coming with some error. Here is my code:
import java.io.*;
import java.util.*;
public class Solution {
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
long a=in.nextLong();
// ERROR: incompatible types: possible lossy conversion from long to int
long[][] b=new long[a][a];
for(long i=0;i<a;i++){
for(long j=0;j<a;j++)
{
//same error here
b[i][j]=in.nextLong();
}
}
}
}