Here is how you can read from the console and fill up the votes
array:
public static void main (String[] args){
String line = null;
int val = 0;
BufferedReader is = new BufferedReader(new InputStreamReader(System.in));
do{
System.out.println("Usage: Enter votes. Enter -1 to exit");
int voteNumber = 0;
while(voteNumber<5){
try {
line = is.readLine();
val = Integer.parseInt(line);
votes[voteNumber] = val;
voteNumber++;
} catch (NumberFormatException ex) {
System.err.println("Not a valid number: " + line);
System.out.println("Usage: Enter votes. Enter -1 to exit");
}
}
}while(val != -1);
}