Admin Teams → Team Forming Constraints
Class Groups
page -- for us to know which team you joined. Note the team ID follows a specific format.Admin Teams → Team ID Format
Admin Teams → Communication
Find basic coding standard violations
Consider the code given below:
import java.util.*;
public class Task {
public static final String descriptionPrefix = "description: ";
private String description;
private boolean important;
List<String> pastDescription = new ArrayList<>(); // a list of past descriptions
public Task(String d) {
this.description = d;
if (!d.isEmpty())
this.important = true;
}
public String getAsXML() { return "<task>"+description+"</task>"; }
/**
* Print the description as a string.
*/
public void printingDescription(){ System.out.println(this); }
@Override
public String toString() { return descriptionPrefix + description; }
}
In what ways the code violate the coding standard you are expected to follow?
Here are three:
descriptionPrefix
is a constant and should be named DESCRIPTION_PREFIX
printingDescription()
should be named as printDescription()
important
should be named to sound boolean e.g., isImportant
There are many more.