J# Not C#
-
I thought you guys might be able to help. I am still undecided about J#. Can anyone explain why the code snippet below would work in J++ but not in J#. The code compiles okay but it cant find the text file to read from. Instad, the exception I catch is J# filenotfoundexception. The text file is in the right directory. Anyways, appreciate any help. public static String[] getIndonesianwordList(String file){ String IndonesianwordList[] = new String[9]; try{ BufferedReader in = new BufferedReader(new FileReader(file)); String s; int i = 0; while((s=in.readLine())!=null){ StringTokenizer tok = new StringTokenizer( s,DELIMITERS); while(tok.hasMoreTokens()) { String nextWord = tok.nextToken(); System.out.println(nextWord); IndonesianwordList[i] = nextWord;//wordList.add(nextWord); i++; } } } catch(IOException e){ System.out.println(e); System.out.println("error loading array"); } return IndonesianwordList; }
-
I thought you guys might be able to help. I am still undecided about J#. Can anyone explain why the code snippet below would work in J++ but not in J#. The code compiles okay but it cant find the text file to read from. Instad, the exception I catch is J# filenotfoundexception. The text file is in the right directory. Anyways, appreciate any help. public static String[] getIndonesianwordList(String file){ String IndonesianwordList[] = new String[9]; try{ BufferedReader in = new BufferedReader(new FileReader(file)); String s; int i = 0; while((s=in.readLine())!=null){ StringTokenizer tok = new StringTokenizer( s,DELIMITERS); while(tok.hasMoreTokens()) { String nextWord = tok.nextToken(); System.out.println(nextWord); IndonesianwordList[i] = nextWord;//wordList.add(nextWord); i++; } } } catch(IOException e){ System.out.println(e); System.out.println("error loading array"); } return IndonesianwordList; }