import java.io.*;
import java.util.*;
import javax.swing.*;
import javax.swing.table.*;
import java.awt.*;
        
public class readfromfile5
{
     public static double[] inputdouble(String filename) throws IOException
     {
	 ArrayList<String> b=new ArrayList<String>();
	 Scanner fin = new Scanner(new File(filename));
     int n=0; 
     int k=0;
     while(fin.hasNext())
     {b.add((String)fin.next());}
     double a[]=new double[b.size()];
     Iterator i=b.iterator();
     while(i.hasNext()) 
     {Double ax=new Double((String)i.next());
      a[k++]=ax.doubleValue();
     }
      return a;
     }
        
     public static String toString(double a[])
     {
	 String s="";
     for(int i=0;i<a.length;i++)
     { s+="a["+i+"] = "+a[i]+"\n";}
     return s;
	 }
               
     	
public static void main(String args[]) throws IOException
{	
  String s1="b.txt";
  double number[]=inputdouble(s1);
  JOptionPane.showMessageDialog(null,toString(number),"sequential file reading",JOptionPane.PLAIN_MESSAGE);
  System.exit(0);
}
}
