Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Date;
- public class NewsItem {
- private String url;
- private String title;
- private String description;
- private Date publicationDate;
- public String getUrl() {
- return this.url;
- }
- public void setUrl(String url) {
- this.url = url;
- }
- public String getTitle() {
- return this.title;
- }
- public void setTitle(String title) {
- this.title = title;
- }
- public String getDescription() {
- return this.description;
- }
- public void setDescription(String description) {
- this.description = description;
- }
- public Date getPublicationDate() {
- return this.publicationDate;
- }
- public void setPublicationDate(String publicationDate) {
- this.publicationDate = new Date(publicationDate);
- }
- @Override
- public String toString() {
- return this.title + "\n" + this.description + "\n" + this.url + "\n" + this.publicationDate.toLocaleString() + "\n================================";
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement