COP2253 Zybooks Chapter Six Flashcards
method
a grouping of predefined statements for repeatedly used operations
method definition
consists of the new method’s name and a block of statements
method call
an invocation of a method’s name, causing the method’s statements to execute
block
a list of statements surrounded by braces
method’s must be defined within a:
class
public
the method may be called from any class in the program
static
the method only uses values that are passed to the method
parameter
a method input specified in a method definition
argument
a value provided to a method’s parameter during a method call
parameters are assigned with argument values by:
position
return statement
used by a method to return one value
void
the method does not return any value (and cannot be used within an expression)
modular development
the process of dividing a program into separate modules that can be developed and tested separately and then integrated into a single program
incremental development
the process in which a programmer writes, compiles, and tests a small amount of code, then a small amount more, and so on.
method stub
a method definition whose statements have not yet been written
unit testing
the process of individually testing a small part or unit of a program, typically a method
testbench
a separate program whose sole purpose it to check that a method return correct output values for a variety of input values
test vector
a unique set of input values used to test a program
the scope of a variable declared inside a method is limited to:
that method
field (or class member variable)
a variable declared within a class but outside any method
method overloading (or method name overloading)
when a program has two methods with the same name but differing in the number or types of parameters
documentation
a written description of a program and its various parts, intended to be read by programmers who must maintain or interface with the program
Javadoc
a tool that parses specially formatted multi-line comments to generate program documentation in HTML format
doc comments
begin with /** and end with */
block tags
a tag in the form @keyword