Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2009
    Posts
    26
    Rep Power
    0

    Default simple line problem / for loop problem

    I am trying to connect variables and strings of text together. My IDE keeps saying it is invalid....

    for(int i = 0;i <=7; i++)
    {
    String chick;
    chick = "game "+i+1+": " + catalog[i]".\n";

    System.out.println("Game"+ i+1+": "+ catalog[i]".\n"); // catalog is a array that
    // holds data.... these are also all the same strings just tried to use differently.
    System.out.println("Game"+ i+1+": "+ catalogp[i]".\n");

    }

    I think that its the way I'm trying to concatenate the code...
    Last edited by helpisontheway; 11-17-2009 at 06:50 AM. Reason: re defining

  2. #2
    CodesAway's Avatar
    CodesAway is offline Senior Member
    Join Date
    Sep 2009
    Location
    Texas
    Posts
    238
    Rep Power
    6

    Default

    Quote Originally Posted by helpisontheway View Post
    I am trying to connect variables and strings of text together. My IDE keeps saying it is invalid....

    for(int i = 0;i <=7; i++)
    {
    String chick;
    chick = "game "+i+1+": " + catalog[i] + ".\n";

    System.out.println("Game"+ i+1+": "+ catalog[i] + ".\n"); // catalog is a array that
    // holds data.... these are also all the same strings just tried to use differently.
    System.out.println("Game"+ i+1+": "+ catalogp[i] + ".\n");

    }

    I think that its the way I'm trying to concatenate the code...
    You're missing some "+" signs.
    CodesAway - codesaway.info
    writing tools that make writing code a little easier

Similar Threads

  1. Help with a loop-like problem
    By Jnoobs in forum New To Java
    Replies: 1
    Last Post: 10-14-2009, 02:15 AM
  2. if else loop problem
    By Ms.Ranjan in forum New To Java
    Replies: 12
    Last Post: 04-25-2009, 10:30 AM
  3. New Line problem in javascript
    By shuvra_pan in forum Advanced Java
    Replies: 3
    Last Post: 03-18-2009, 04:54 PM
  4. Some while loop problem need help
    By shaggyoo7 in forum New To Java
    Replies: 4
    Last Post: 01-14-2009, 08:16 PM
  5. graphic line problem
    By f_the_cook in forum Advanced Java
    Replies: 3
    Last Post: 12-08-2008, 06:45 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
  •