Advertisement
deyanmalinov

02. Articles - part 2

Mar 12th, 2019
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.98 KB | None | 0 0
  1. package DPM;
  2.  
  3. public class Article {
  4.     private String title;
  5.     private String content;
  6.     private String author;
  7.  
  8.     public String getTitle() {
  9.         return title;
  10.     }
  11.  
  12.     public String getContent() {
  13.         return content;
  14.     }
  15.  
  16.     public String getAuthor() {
  17.         return author;
  18.     }
  19.  
  20.     public void setTitle(String title) {
  21.         this.title = title;
  22.     }
  23.  
  24.     public void setContent(String content) {
  25.         this.content = content;
  26.     }
  27.  
  28.     public void setAuthor(String author) {
  29.         this.author = author;
  30.     }
  31.  
  32.     public Article(String title, String content, String author) {
  33.         this.title = title;
  34.         this.content = content;
  35.         this.author = author;
  36.     }
  37.     public void edit(String newContend){
  38.         this.content = newContend;
  39.     }
  40.     public void changeAuthor(String newAuthor){
  41.         this.author = newAuthor;
  42.     }
  43.     public void rename (String rename){
  44.         this.title = rename;
  45.     }
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement