Adding new objects to Vector

Posted on 2004-11-05
Last Modified: 2010-03-31
public static void main(String [] args)
// The empty vector that will be used to store accounts
Vector accountVector = new Vector();

// New class methods
// public is missing so that it can remain in this file.
class inOut
      private static String line;
      private static String txtFileIn = "account.txt";
      static BufferedReader a = null;
      static StringTokenizer theStrings;
      static boolean done = false;

      public static void readInAccounts(Vector accountVector)
            // reads text file for input
                  FileInputStream b = new FileInputStream(txtFileIn);
                  a = new BufferedReader(new InputStreamReader(b));

            // exceptions omitted
                line = a.readLine()

Will this line of thought add the current line being read in a file as an object in a vector?

If not how should I be thinking?
Question by:smkJackstraw
    1 Comment
    LVL 92

    Accepted Solution

    yes, it will read the first line of the file
    use a loop if you'd like to read more

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
    Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
    Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
    Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now