Error:index 2 out of bounds for length 2 at test.main
Pretty clear from error that there seems to be only 2 values in an array object (corresponding to index 0 & 1), thus while accessing index 2, it throws an error.
studenti[i]=new Student(values[0],values[1],Integer.parseInt(values[2]));
Suspecting, mostly this line. You must have passed only 2 values comman separated as input leading to an error when you tried to access values[2]
Couple of suggestions:
1. Make sure to check for length before accessing the index
2. Use IDE Debugger and it would be easy to figure whats wrong. You will learn more when you do.