|
はじめまして。最近Javaを始めたものです。 今、一番古い時間に作られたものと、二番目に古い時間に作られたものを 可視化させるプログラムを以下のコードをベース に、組み込みたいのですが、書き加えるだけで実行可能でしょうか? 教えてください。よろしくお願いします。 _____________________ (中略)
public class HistoryInformation { long createdAt=0l; long lastModifiedAt=0l;
public HistoryInformation() { long now = new Date().getTime(); createdAt = now; lastModifiedAt = now; } public HistoryInformation(Date createdAt, Date lastModifiedAt) { this.createdAt = createdAt.getTime(); this.lastModifiedAt = lastModifiedAt.getTime(); } public Date getCreatedAt() { return new Date(createdAt); } public Date getLastModifiedAt() { return new Date(lastModifiedAt); } public void setCreatedAt(Date createdAt) { this.createdAt = createdAt.getTime(); } public void setLastModifiedAt(Date lastModifiedAt) { this.lastModifiedAt = lastModifiedAt.getTime(); } }
|