Guest User

Untitled

a guest
Jul 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. package kursach;
  2.  
  3. public class Comment {
  4. private String comment;
  5. private User userName;
  6.  
  7. public Comment(String comment, User userName) {
  8. this.comment = comment;
  9. this.userName = userName;
  10. }
  11.  
  12. public String getComment() {
  13. return comment;
  14. }
  15.  
  16. @Override
  17. public String toString() {
  18. return "Comment {" + "User: "+
  19. userName.getName()+
  20. " = '" + comment + '\'' +'}'+ "\n";
  21. }
  22. }
Add Comment
Please, Sign In to add comment