Lost Password?


Go Back   CodeCall Programming Forum > Software Development > Java Help

Java Help Java Help forum discussing all Java platforms - J2ME, J2SE and J2EE - as well as relevant standards, APIs and frameworks such as Swing, Servlets, JSPs, Applets, Struts, Spring, Hibernate, ANT, EJB, and other Java-related topics.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-12-2007, 05:28 AM
Igor Igor is offline
Newbie
 
Join Date: Oct 2007
Posts: 5
Rep Power: 0
Igor is on a distinguished road
Default repetition

Hi all,

I'm really new to java and have a heap of code that I'm now trying to get acquinted with. Don't know if this is the right place to post this question, but here it is:

System.out.println("User " + ret.name + ret.place);
Which is a line of the code. Not important right now what it does or why, but suppose I want to allow the program to retrieve (which I say "ret." means right?) possibly more than one name/place for a user.
Eclipse (which I'm working in) doesn't really seem to like:
System.out.println("User " + ret.name* + ret.place*);

Can anyone tell me if there is a possibily to do this the above way (and that it's just some incorrect syntax), or that something like that won't work at all and I'll have to find a solution somewhere else in the program.

thanks,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 12-12-2007, 05:53 AM
Igor Igor is offline
Newbie
 
Join Date: Oct 2007
Posts: 5
Rep Power: 0
Igor is on a distinguished road
Default

In addition:
This name and place calls to some dictionary where names and places are alternating (and, of course, are supposed to match). So something like "name:John, place:New York, name:Richard, place:New Delhi, name:Little, name:George, placearis" and so on.
Problem is that as you see some people have double names.
So something like
System.out.println("User " + ret.name + ret.name + place);
just results in John John New York. I want the program to keep n taking names until it bumps into a place.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-12-2007, 02:01 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 20
Posts: 3,469
Last Blog:
Joomla! And Incompeten...
Rep Power: 20
John has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond reputeJohn has a reputation beyond repute
Send a message via AIM to John Send a message via MSN to John
Default

It might be incorrect syntax, but without knowing how the ret class is setup, it would be impossible to tell. In eclipse, if you put your cursor on ret.name and I believe, press Ctrl+1 it shows you possible fixes.
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Forum Jump


All times are GMT -5. The time now is 03:00 AM.

Contest Stats

WingedPanther ........ 2753.6
Xav ........ 2704
Brandon W ........ 1702.32
John ........ 1207.73
marwex89 ........ 1175.24
morefood2001 ........ 966.05
dcs ........ 655.75
Steve.L ........ 475.59
orjan ........ 418.58
Aereshaa ........ 383.54

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 100%


Complete - Celebrate!

Ads