Advertisement
calcpage

C3X8_Letter.java(finished)

Oct 7th, 2011
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.40 KB | None | 0 0
  1. //Letter.java   MrG 2011.1006
  2. public class Letter
  3. {
  4.     private String from;
  5.     private String body;
  6.     private String to;
  7.  
  8.     public Letter(String from, String to)
  9.     {
  10.         this.from = from;
  11.         this.body = "\n";
  12.         this.to = to;
  13.     }
  14.  
  15.     public void addLine(String line)
  16.     {
  17.         body = body + line + "\n";
  18.     }
  19.  
  20.     public String getText()
  21.     {
  22.         return "Dear " + to + ",\n" + body + "\nSincerely, \n" + from;
  23.     }
  24. }
  25.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement