|
Having trouble with array
Hi im new to java and I am having a hard time trying to figure out why the input file is initialized into the array. When the array prints I simply get 26zeroes. Any help would be greatly appreciated.
Thank you.
import java.util.*;
import java.io.FileInputStream;
import java.io.*;
public class me
{
static final int ARRAY_SIZE=26;
static Scanner console=new Scanner(System.in);
public static void main(String[]args)
throws FileNotFoundException, IOException
{
int []list=new int[26];
int counter=0;
String s="ABCD";
char A=s.charAt(0);
int i=(int)A;
Scanner inputStream=new Scanner(new FileReader("MessageIn.txt"));
for(i=0;i<26;i++)
System.out.print(list[i]+"");
int maxIndex;
int largestList;
maxIndex=0;
for(i=1;i<26;i++)
if(list[maxIndex]<list[i])
maxIndex=i;
largestList=list[maxIndex];
}
}
|