File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Cattle Drive and the fly likes LookUp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » This Site » Cattle Drive
Bookmark "LookUp " Watch "LookUp " New topic
Author

LookUp

Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
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

Joined: Apr 12, 2001
Posts: 1012
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).]


what?
Pauline McNamara
Sheriff

Joined: Jan 19, 2001
Posts: 4012
    
    6
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

Joined: May 08, 2001
Posts: 1932
Don't forget you can concatenate Strings by usign the + operator and a few \n's.
Jason
Greg Harris
Ranch Hand

Joined: Apr 12, 2001
Posts: 1012
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

Joined: Jan 19, 2001
Posts: 4012
    
    6
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

Joined: May 08, 2001
Posts: 1932
*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

Joined: Jan 19, 2001
Posts: 4012
    
    6
*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
 
GeeCON Prague 2014
 
subject: LookUp