title: reading a string, int, and double from csv file
body: <p>Hello everyone i am trying to read a string, an int and a double from a csv file. This is a sample from my csv file:</p>
  
  <pre><code>World Development Indicators
  Number of countries,252
  CountryName,1960,1961,1962,1963,1964,1965,1966,1967,1968,1969,1970,1971,1972,1973,1974,1975,1976,1977,1978,1979,1980,1981,1982,1983,1984,1985,1986,1987,1988,1989,1990,1991,1992,1993,1994,1995,1996,1997,1998,1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009,2010,2011,2012
  Aruba,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.029310471,0,0,2.138784453,3.605985937,3.98141538,6.16435217,13.48254011,16.50927821,57.05427692,65.05605558,72.10431377,99.64250268,103.3849507,108.1325002,112.2180618,119.2038996,126.2103374,129.72824,0,131.8565401
  Andorra,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1.307211734,1.278625641,1.250259142,4.424155104,8.538444783,13.44671556,22.12730607,32.14530928,35.99902139,43.27794118,45.77115817,68.60251444,73.82494308,79.48487497,84.27763597,78.1171579,80.2836099,82.06181111,84.06818386,83.53432222,81.50204186
  Afghanistan,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.112598381,0.865196277,2.498055472,4.826865367,9.833164022,17.71624331,29.22037376,37.89493697,45.77817474,60.32631999,60.35299258.
  </code></pre>
  
  <p>I am required to read the string into an array called <code>String[] countryNames</code>, read the years and store it into an <code>int[] yearLabels</code> and finally the double <code>double[][] cellularDataTable</code>.</p>
  
  <p>I created a function for each array called <code>public String[] getCountryNames()</code>, <code>public int[] getYearLabel()</code>, and <code>public data[][] getCellularDataTable()</code>. I  created my class called <code>Class CSVReader</code> and those methods are in my class. In the String array function i am meant to skip the first line of the class and read the line <code>Number of countries,252</code> and store 252 for the size of the array of the string and return it or store each country into the string array. My algorithm is wrong and would need some guidance. The year function is only meant to read the years, so basically get the row of country and store in the years, and the double[][] function reads the country and the stats. Because i will be passing the arrays into my TestClass such as:</p>
  
  <pre><code> CSVReader parser = new CSVReader(FILENAME);
   String [] countryNames = parser.getCountryNames();
   int [] yearLabels = parser.getYearLabels();
   double [][] parsedTable = parser.getCellularDataTable();
  </code></pre>
  
  <p>Below is my CSVReader class file:</p>
  
  <pre><code>import java.io.*;
  import java.util.Scanner;
  
  public class CSVReader {
  String[] countryNames;
  int[] yearNum;
  double[][] tables;
  Scanner scan;
  
  public CSVReader(String filename)// throws FileNotFoundException 
  { 
      File file = new File(filename);
      try
      {
          scan = new Scanner(file);
      }
      catch(FileNotFoundException e)
      {
          System.out.println(e.getMessage());
      }
  
  }
  
  public String[] getCountryNames()
  {
      scan.nextLine();
      while(scan.hasNext())
      {
          final String input = scan.nextLine();
          String[] country = input.split(",");
          //int a = Integer.parseInt(countryNames[1]);
          System.out.println(country[0]);
          int numberOfCountries = Integer.parseInt(country[1]);
      }
      scan.close();
  }
  public int[] getYearLabels()
  {
  
  }
  public double[][] getParsedTable()
  {
  
  }
  }
  </code></pre>
  
  <p>If some can can give me example of how to store the strings, int and double i believe i can understand. I think i have my idea down just don't know how to implement the code. Will appreciate the help and i am new to programming. Thanks</p>