From ec716f516f3f6921e2a760e71dd16a9256798343 Mon Sep 17 00:00:00 2001 From: dengxitong <2452879460@qq.com> Date: Sun, 31 May 2026 16:28:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20'w9/Article.java'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- w9/Article.java | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 w9/Article.java diff --git a/w9/Article.java b/w9/Article.java new file mode 100644 index 0000000..cd58eb9 --- /dev/null +++ b/w9/Article.java @@ -0,0 +1,31 @@ +import java.time.LocalDate; + +public class Article { + private String title; + private String content; + private String url; + private String author; + private LocalDate publishDate; + + public Article(String title, String content, String url, String author, LocalDate publishDate) { + this.title = title; + this.content = content; + this.url = url; + this.author = author; + this.publishDate = publishDate; + } + + public String getAuthor() { return author; } + public void setAuthor(String author) { this.author = author; } + + public LocalDate getPublishDate() { return publishDate; } + public void setPublishDate(LocalDate publishDate) { this.publishDate = publishDate; } + + @Override + public String toString() { + return "标题:" + title + + " | 作者:" + author + + " | 发布日期:" + publishDate + + " | 链接:" + url; + } +} \ No newline at end of file