Search:

Type: Posts; User: Norm

Search: Search took 0.13 seconds.

  1. Replies
    15
    Views
    1,393

    Re: Formatting a text file

    The StringBuilder class is a place to put different types of data that you want to see in a String. I'm not sure what you mean by "format each line".

    The Scanner methods will read the lines from...
  2. Replies
    15
    Views
    1,393

    Re: Formatting a text file

    StringBuilder does not read files. Use the Scanner class to read files.

    The assignment should specify what to put into the StringBuilder.
  3. Replies
    15
    Views
    1,393

    Re: Formatting a text file

    Start by experimenting with the StringBuilder class to see how it works and what can be done with it.

    Perhaps when you see how to use the class's methods, you'll get some ideas about the...
  4. Replies
    15
    Views
    1,393

    Re: Formatting a text file

    If the lines are in String objects, the String class has a method that gives the length of the String.

    The StringBuilder class is used to build Strings. Use its methods to add data to it. When...
  5. Replies
    15
    Views
    1,393

    Re: Formatting a text file

    Did you work out how to use the PrintWriter class? I'd recommend working on one thing at a time, getting it to work and then move on to the next thing. Trying to do it all at one time usually...
  6. Replies
    15
    Views
    1,393

    Re: Formatting a text file

    Use a class like the PrintWriter class to write text to the file. To see how it works, write a small, simple program that creates a PrintWriter object to write to a file and call some of its...
  7. Replies
    15
    Views
    1,393

    Re: Formatting a text file

    Can you explain your problem using the StringBuilder class.
  8. Replies
    15
    Views
    1,393

    Re: Formatting a text file

    Can you explain what problems you are having and ask some specific questions?

    Please edit your post and wrap your code with code tags:


    <YOUR CODE HERE>

    to get highlighting and preserve...
Results 1 to 8 of 8