aspose file tools*
The moose likes Java in General and the fly likes return? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "return? " Watch "return? " New topic
Author

return?

Rayt Leeop
Greenhorn

Joined: Jun 09, 2011
Posts: 23
The code:

public String toString() {
return "X=" + x + " " + "Y=" + y;
}


the result is "x=.., y=.."

How can I make xw in two lines:
x=...
y=...
Thanks
Christopher Nortje
Greenhorn

Joined: Jul 09, 2010
Posts: 16
Just add a newline (line feed) character instead of the space " " use "\n"
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38334
    
  23
Better not to use \n unless you specificially require \n. You actually want line end. It would be better to use the %n tag:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: return?