What I meant by the psuedocode "Ignore token and go on" was to simply just do nothing with the token. Just add the ones that are ints.
String temp;
// I just fixed it to define temp before the...
Type: Posts; User: javapenguin
What I meant by the psuedocode "Ignore token and go on" was to simply just do nothing with the token. Just add the ones that are ints.
String temp;
// I just fixed it to define temp before the...
Also, you have an empty else.
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.StringTokenizer;
public class Main {
private static String...
sCurrentLIne = s.readLine();
For starters, what exactly are you trying to add?
Each number individually, each number as a pair, each number as a pair with reference to another pair?
To add it, do something perhaps like...
Well, to separate the numbers and the text and symbols, maybe you could use a StringTokenizer.
StringTokenizer (Java 2 Platform SE v1.4.2)
int n = myArray.size();
for (int i = 0; i < n; i++) {
System.out.println(myArray.get(i));
}
You never added anything.
Your size will be 0.
You have to
// Print line as read from file
System.out.println(sCurrentLine)
Well, to just print out the lines alone read from the file without doing anything to them,
well....you'd need...
mat = pat.matcher(sCurrentLine);
sCurrentLine hasn't been initialized yet.
sCurrentLine = s.readLine()) != null
First off,
sCurrentLine ==s.readLine()
while ((sCurrentLine = s.readLine()) != null) {
This line won't work.