Results 1 to 2 of 2
  1. #1
    orangefest is offline Member
    Join Date
    Apr 2009
    Posts
    1
    Rep Power
    0

    Default for loops and escape sequences

    Hi there, any ideas on how to use the "\t" escape sequence to print a series of variables using a for loop? Basically, I'm trying to write a program that will generate some random names and ages in a column format. Like this:

    James David Kathy
    18 26 17

    I've figured out how to generate the random names and ages, just can't figure out how to print them in this format. Any ideas would be greatly appreciated. thanks

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    System.out.printf()
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

Similar Threads

  1. Escape Sequence
    By Punter in forum New To Java
    Replies: 4
    Last Post: 02-10-2009, 08:04 AM
  2. Escape Sequence \t does not display.
    By dreamingofgreen in forum New To Java
    Replies: 7
    Last Post: 07-22-2008, 05:50 AM
  3. Using escape sequence with like clause (%)
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 02-14-2008, 10:57 AM
  4. Generating number sequences
    By hawkmauk in forum New To Java
    Replies: 0
    Last Post: 11-15-2007, 04:32 PM
  5. Oracle sequences
    By orchid in forum JDBC
    Replies: 5
    Last Post: 04-19-2007, 04:47 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •