@@ -17,7 +17,7 @@ public class AddCommand extends Command {
1717 * Creates a AddCommand object for execution.
1818 *
1919 * @param instruction user instruction.
20- * @param task task name of the user in String .
20+ * @param task content of the user task .
2121 * @param date date of the user task to be done.
2222 */
2323 public AddCommand (String instruction , String task , String date ) {
@@ -35,10 +35,12 @@ public AddCommand(String instruction, String task, String date) {
3535 /**
3636 * This method handles todo instruction and creates a Todo task.
3737 *
38- * @param task name of the user task.
38+ * @param task content of the user task.
3939 */
4040 private static String handleToDo (String task ) {
4141 Todo todo = new Todo (task );
42+
43+ // Update the task list and statistics with the new task.
4244 TaskList .addTask (todo );
4345 Statistics .updateStatistics (todo );
4446 return Ui .createAddResponse (todo );
@@ -47,10 +49,12 @@ private static String handleToDo(String task) {
4749 /**
4850 * This method handles deadline instruction and creates a Deadline task.
4951 *
50- * @param task name of the user task.
52+ * @param task content of the user task.
5153 */
5254 private static String handleDeadline (String task , String date ) {
5355 Deadline deadlines = new Deadline (task , date );
56+
57+ // Update the task list and statistics with the new task.
5458 TaskList .addTask (deadlines );
5559 Statistics .updateStatistics (deadlines );
5660 return Ui .createAddResponse (deadlines );
@@ -59,10 +63,12 @@ private static String handleDeadline(String task, String date) {
5963 /**
6064 * This method handles event instruction and creates a Event task.
6165 *
62- * @param task name of the user task.
66+ * @param task content of the user task.
6367 */
6468 private static String handleEvent (String task , String date ) {
6569 Event event = new Event (task , date );
70+
71+ // Update the task list and statistics with the new task.
6672 TaskList .addTask (event );
6773 Statistics .updateStatistics (event );
6874 return Ui .createAddResponse (event );
0 commit comments