Week 13: Java Methods Flashcards
It is a program module that contains a series of statements that carry out a task.
Method
It can execute additional methods.
The main() method
A block of code which only runs when it is called.
A method
You can pass data, known as parameters, into a _______.
method.
Methods are used to perform certain actions, and they are also known as _________.
Functions
The access specifier for a Java
method can be any of the following modifiers:
public, private, protected, or, if left unspecified, package
A method that returns no data has a return type of _____.
void
A method might return a value, or send it back, to its calling method.
The return type for the method
The _____ name can be any legal identifier; it must be one word with no embedded spaces, and cannot be a Java keyword.
method
The _______ optionally might
contain data to be sent to the method.
parentheses
The method ____ is where the code goes.
body
When no access modifier is specified, it is treated as default modifier. Its scope is limited within the package.
Default structure of a method
The word itself indicates that it has scope everywhere; it is visible everywhere even outside the package.
Public structure of a method
It is an inbuilt method in Java which is used to return Minumum or Lowest value from the given two arguments.
Math.min()
It is an inbuilt method in Java which is used to return Maximum or Highest value from the given two arguments.
Math.max()