Comment.java


The script Comment.java contains the data we will save in the database and show in the user interface. It defines two private attributes: Five methods are also defined in this class and their functions are obvious from their names:
src/main/java/com/example/wenchen/sqlitedemo/Comment.java
package com.example.wenchen.sqlitedemo;

public class Comment {
  private long id;
  private String comment;

  public long getId( ) {
    return id;
  }

  public void setId( long id ) {
    this.id = id;
  }

  public String getComment( ) {
    return comment;
  }

  public void setComment( String comment ) {
    this.comment = comment;
  }

  // Will be used by the ArrayAdapter in the ListView.
  @Override
  public String toString( ) {
    return comment;
  }
}




      I visited my friend at his new house.    
      He told me to make myself at home.    
      So I threw him out.    
      I hate having visitors.