Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

LookUp

 
Pauline McNamara
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Been plugging away at Rudy's Rental Shop, and have come upon a conceptual stumbling block (sounds good, eh? OK, so it's a brain failure. Anyway...).
The method getDescription returns a String. I can think of ways of having a method print several strings out directly, so that it looks like a list of descriptive info. I'm a bit stuck, however, on how to return "one" String that is formatted as I imagine it. Certainly I'm missing something simple here - any clues?
Thanks,
Pauline
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you can print several strings together directly from the method that are formatted to look the way i think it should look \ or, at least the way i passed.

[This message has been edited by Greg Harris (edited November 14, 2001).]
 
Pauline McNamara
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Greg Harris:
you can print several strings together directly from the method ...

Hmmm. Here I picture a method with a return type of void rather than String.
?
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Don't forget you can concatenate Strings by usign the + operator and a few \n's.
Jason
 
Greg Harris
Ranch Hand
Posts: 1012
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay, just go ahead and say it, Jason! i guess i was being too cryptic by not explicitly saying use the "\n". also, my method is not void...
 
Pauline McNamara
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh those pesky + and \n 's. Yeh, I had started playing with those, guess I gave up too soon.
Thanks, Greg, for being cryptic.
Thanks, Jason, for just saying it.
 
jason adam
Chicken Farmer ()
Ranch Hand
Posts: 1932
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*mutters* Next time I'll say it in pig-latin
I guess that was quite a "hint", you owe me Pauline *cackle*
Jason
 
Pauline McNamara
Sheriff
Posts: 4012
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
*squeals and snorts* pig latin! esyay!
Just to make you feel better Jason, Greg's post actually gave away the solution to my problem: while fumbling around for the solution I had tried using \n's but had forgotten to put " " around them!
*mutters back* ok, ok, so I owe you one.
Pauline
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic