Search:

Type: Posts; User: Norm

Search: Search took 0.13 seconds.

  1. Re: Code to open up a txt file and display only first five lines?

    Use a variable to count the number of lines read and displayed. End the loop when the counter says 5 lines have been processed.

    Hint: the condition used by the while statement can have multiple...
  2. Re: Code to open up a txt file and display only first five lines?

    The Scanner class's methods are easier to use for reading text files.

    You should NOT name your classes with the same name as classes in Java SE.
  3. Re: Code to open up a txt file and display only first five lines?

    Take a look at the tutorial:
    The for Statement (The Java™ Tutorials > Learning the Java Language > Language Basics)
    The while and do-while Statements (The Java™ Tutorials > Learning the Java...
Results 1 to 3 of 3