-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask.java
More file actions
58 lines (49 loc) · 1.61 KB
/
Task.java
File metadata and controls
58 lines (49 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
public class Task {
private int id;
private String title;
private String description;
private String dueDate;
private boolean isCompleted;
public Task(int id, String title, String description, String dueDate, boolean isCompleted) {
this.id = id;
this.title = title;
this.description = description;
this.dueDate = dueDate;
this.isCompleted = isCompleted;
}
public int getId() {
return id;
}
public String getTitle() {
return title;
}
public String getDescription() {
return description;
}
public String getDueDate() {
return dueDate;
}
public boolean isCompleted() {
return isCompleted;
}
public void setCompleted(boolean completed) {
isCompleted = completed;
}
public void printTask() {
System.out.println("------------ Task Details ------------");
System.out.println("Task ID : " + id);
System.out.println("Title : " + title);
System.out.println("Description : " + description);
System.out.println("Due Date : " + dueDate);
System.out.println("Completed : " + (isCompleted ? "Yes" : "No"));
System.out.println("--------------------------------------");
}
@Override
public String toString() {
return "Task ID: " + id +
" | Title: " + title +
" | Description: " + description +
" | Due Date: " + dueDate +
" | Completed: " + (isCompleted ? "Yes" : "No");
}
}