Week 13: Java Methods Flashcards

1
Q

It is a program module that contains a series of statements that carry out a task.

A

Method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

It can execute additional methods.

A

The main() method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

A block of code which only runs when it is called.

A

A method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

You can pass data, known as parameters, into a _______.

A

method.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Methods are used to perform certain actions, and they are also known as _________.

A

Functions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The access specifier for a Java
method can be any of the following modifiers:

A

public, private, protected, or, if left unspecified, package

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

A method that returns no data has a return type of _____.

A

void

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

A method might return a value, or send it back, to its calling method.

A

The return type for the method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

The _____ name can be any legal identifier; it must be one word with no embedded spaces, and cannot be a Java keyword.

A

method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

The _______ optionally might
contain data to be sent to the method.

A

parentheses

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

The method ____ is where the code goes.

A

body

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

When no access modifier is specified, it is treated as default modifier. Its scope is limited within the package.

A

Default structure of a method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

The word itself indicates that it has scope everywhere; it is visible everywhere even outside the package.

A

Public structure of a method

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

It is an inbuilt method in Java which is used to return Minumum or Lowest value from the given two arguments.

A

Math.min()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

It is an inbuilt method in Java which is used to return Maximum or Highest value from the given two arguments.

A

Math.max()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly