Skip to content

Instantly share code, notes, and snippets.

@theawesomenayak
Last active October 5, 2022 10:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theawesomenayak/8b7e73c5a0c3dc6787cb1ec4505f84cf to your computer and use it in GitHub Desktop.
Save theawesomenayak/8b7e73c5a0c3dc6787cb1ec4505f84cf to your computer and use it in GitHub Desktop.
public final class NewsItem {
private String title;
private String pubDate;
public String getTitle() {
return title;
}
public void setTitle(final String title) {
this.title = title;
}
public String getPubDate() {
return pubDate;
}
public void setPubDate(final String pubDate) {
this.pubDate = pubDate;
}
@Override
public String toString() {
return String.format("{\"title\": \"%s\", \"date\": \"%s\"}",
this.title, this.pubDate);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment