Skip to content

Instantly share code, notes, and snippets.

@damithc
Last active January 31, 2020 05:41
Show Gist options
  • Save damithc/c27161d3472ca2e2fe0fba923c81fc77 to your computer and use it in GitHub Desktop.
Save damithc/c27161d3472ca2e2fe0fba923c81fc77 to your computer and use it in GitHub Desktop.
CS2113-M16: Tutorial 3, task 5
import java.util.*;
public class Manage_Task {
private String description;
private boolean important;
private int i; // used to count tasks
String pastDescription[] = new String[10]; // a list of past descriptions
public Manage_Task(String d) {
this.description = d;
if (!d.isEmpty())
// set as important
this.important = true;
}
public String getAsXML() { return "<task>"+description+"</task>"; }
public void printingDescription(){ System.out.println(this); }
public String toString() { return description; }
}
@cheongisabella
Copy link

Line 7: It should be String[] pastDescriptions instead of String pastDescription[]. Array specifiers must be attached to the type not the variable, and it should be plural form as stated by one of the comments above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment