Advertisement
calcpage

C3X8_Letter.java

Oct 6th, 2011
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.37 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.to = to;
  12.     }
  13.  
  14.     public void addLine(String line)
  15.     {
  16.         body = body + line;
  17.     }
  18.  
  19.     public String getText()
  20.     {
  21.         return "Dear " + to + ",\n" + body + "\nSincerely, \n" + from;
  22.     }
  23. }
  24.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement