Skip to content

Instantly share code, notes, and snippets.

@juthawong
Created January 7, 2016 12:43
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 juthawong/392a2bdc3c3ad2b244b9 to your computer and use it in GitHub Desktop.
Save juthawong/392a2bdc3c3ad2b244b9 to your computer and use it in GitHub Desktop.
package com.example;
import java.util.Date;
public class BlogPost {
private String mAuthor;
private String mTitle;
private String mBody;
private String mCategory;
private Date mCreationDate;
public BlogPost(String author, String title, String body, String category, Date creationDate) {
mAuthor = author;
mTitle = title;
mBody = body;
mCategory = category;
mCreationDate = creationDate;
}
public String getAuthor() {
return mAuthor;
}
public String getTitle() {
return mTitle;
}
public String getBody() {
return mBody;
}
public String getCategory() {
return mCategory;
}
public Date getCreationDate() {
return mCreationDate;
}
public String[] getWords(){
return mBody.split("\\s+");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment