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