Download Week6 - School of Computing

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Document related concepts

Reactive programming wikipedia , lookup

Scala (programming language) wikipedia , lookup

Falcon (programming language) wikipedia , lookup

C syntax 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

Java performance wikipedia , lookup

C Sharp (programming language) wikipedia , lookup

Transcript
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