0

Need assistance with formatting the output; everything prints out in one line.

I want the output to look more like a letter

firstname lastname
123 main street
miami, oh 90210

Dear firtname lastname,

text text text
more text
more text

sincerily,
blah

> /public class Letter {
> 
> /private String firstname;
> /private String lastname;
> /private String address;
> /private String text;
> 
> 
> /public Letter (String fname, String lname, String add, String tx){           
> /firstname = fname;
> /lastname = lname;
> /address = add;
> /text = tx;
> /}
> 
> 
> /public String toString(){            
> /return firstname + lastname + address + text;
> /     }
> /}
> 
> 
> /public class LetterPrinter {
> 
> /public static void main(String ] args) {
> /Letter newletter = new Letter("firstname", "lastname", "123 Main Street Avenue Miami,OH 90210", "firstname lastname," +
> /     "text text text." +
> /     "Something something something" +
> /     "more text text text");
> /     System.out.println(newletter);  
2
Contributors
1
Reply
2
Views
4 Years
Discussion Span
Last Post by JamesCherrill
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.