Put it on a method instead... and invoke it when some event fired....
Don't forget to use close() method after that process....
while (scanner.hasNext())
int a = (scanner.next());
int b = (scanner.next());
int c = (scanner.next());
int d = (scanner.next());
int e = (scanner.next());
be careful when to use braces and when not to use it....
that code would only store the data from the file to variable a.
And about that implementation, i think you should initialize those variables on member's field....(global variable)
So that, you can just implement directly setters/getters method...