* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
Download Week6 - School of Computing
Reactive programming wikipedia , lookup
Scala (programming language) wikipedia , lookup
Falcon (programming language) wikipedia , lookup
Name mangling wikipedia , lookup
Object-oriented programming wikipedia , lookup
Structured programming wikipedia , lookup
Go (programming language) wikipedia , lookup
Java (programming language) wikipedia , lookup
C Sharp syntax wikipedia , lookup
Modular Programming (3/6)
ï®
A well-defined module
ï±
ï±
ï±
ï®
Has a good name (for readability and documentation)
Has a clear interface (what parameters does it take?)
May pass back to its caller no result or a single result (what
value does it return?)
Itâs nothing new! You have seen them before.
ï±
Example: setColour(String c) in the Ball class
public void setColour(String c) {
colour = c;
}
ï±
Takes in String c.
Does not return
any value (void).
Example: getColour() in the Ball class
public String getColour() {
return colour;
}
© CS1101 (AY2009-2010 Semester 1)
Takes in no
parameter.
Returns a String.
Week6 - 6