I need to count the number of votes for candidates... I'm getting an unreachable statement error on "int[] array = new int[6];"
Scanner sc= new Scanner(System.in);
int a= sc.nextInt();
return a;
int[] array = new int[6];
int mitt;
mitt= array [a];
int rick;
rick= array [a];
int newt;
newt= array [a];
int ron;
ron= array [a];
int other;
other= array [a];
int invalid;
invalid= array [a];
if (a==0)
{mitt++;
System.out.println(mitt);}
else if (a==1)
{rick++;
System.out.println(rick);}
else if (a==2)
{newt++;
System.out.println(newt);}
else if (a==3)
{ron++;
System.out.println(ron);}
else if (a==4)
{other++;
System.out.println(other);}
else
{invalid--;
System.out.println(invalid);}
return array [a];