Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Article {
- String title;
- String content;
- String author;
- Article(String title, String content, String author){
- this.title = title;
- this.content = content;
- this.author = author;
- }
- public void edit(String newContent){
- this.content = newContent;
- }
- public void changeAuthor(String author){
- this.author = author;
- }
- public void rename(String title){
- this.title = title;
- }
- @Override
- public String toString() {
- return String.format("%s - %s:%s",
- this.title, this.content, this.author.);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement