Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-17-2009, 06:46 AM
Member
 
Join Date: Nov 2009
Posts: 26
Rep Power: 0
helpisontheway is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 11-17-2009, 07:12 AM
CodesAway's Avatar
Senior Member
 
Join Date: Sep 2009
Location: Texas
Posts: 236
Rep Power: 1
CodesAway is on a distinguished road
Default
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
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with a loop-like problem Jnoobs New To Java 1 10-14-2009 02:15 AM
if else loop problem Ms.Ranjan New To Java 12 04-25-2009 10:30 AM
New Line problem in javascript shuvra_pan Advanced Java 3 03-18-2009 04:54 PM
Some while loop problem need help shaggyoo7 New To Java 4 01-14-2009 08:16 PM
graphic line problem f_the_cook Advanced Java 3 12-08-2008 06:45 PM


All times are GMT +2. The time now is 06:27 AM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org