Search:

Type: Posts; User: javapenguin

Search: Search took 0.15 seconds.

  1. Replies
    17
    Views
    757

    Re: Array Lists help!!

    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...
  2. Replies
    17
    Views
    757

    Re: Array Lists help!!

    Also, you have an empty else.
  3. Replies
    17
    Views
    757

    Re: Array Lists help!!

    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...
  4. Replies
    17
    Views
    757

    Re: Array Lists help!!

    sCurrentLIne = s.readLine();
  5. Replies
    17
    Views
    757

    Re: Array Lists help!!

    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...
  6. Replies
    17
    Views
    757

    Re: Array Lists help!!

    Well, to separate the numbers and the text and symbols, maybe you could use a StringTokenizer.
    StringTokenizer (Java 2 Platform SE v1.4.2)
  7. Replies
    17
    Views
    757

    Re: Array Lists help!!

    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
  8. Replies
    17
    Views
    757

    Re: Array Lists help!!

    // 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...
  9. Replies
    17
    Views
    757

    Re: Array Lists help!!

    mat = pat.matcher(sCurrentLine);

    sCurrentLine hasn't been initialized yet.
  10. Replies
    17
    Views
    757

    Re: Array Lists help!!

    sCurrentLine = s.readLine()) != null

    First off,

    sCurrentLine ==s.readLine()

    while ((sCurrentLine = s.readLine()) != null) {

    This line won't work.
Results 1 to 10 of 11