Exam 7: Using Methods

arrow
  • Select Tags
search iconSearch Question
flashcardsStudy Flashcards
  • Select Tags

Methods can ____, or call, other methods; that is, a program uses a method's name and the method performs a job for the class.

Free
(Multiple Choice)
4.9/5
(41)
Correct Answer:
Verified

D

Because the ReadLine() method call can be assigned to a string, its return type is ____ .

Free
(Multiple Choice)
4.8/5
(33)
Correct Answer:
Verified

D

A parameter within a method header is called a(n) ____ parameter.

Free
(Multiple Choice)
4.9/5
(37)
Correct Answer:
Verified

A

Describe how nested method calls work. For example, if you have three nested method calls, which method executes first and how are return values propagated? Is there a limit to how many method calls can be nested?

(Essay)
4.8/5
(44)

A method ____ is a variable that holds data passed to the method when it is called; it receives an argument's value when the method executes.

(Multiple Choice)
4.7/5
(42)

A ____ statement causes a value to be sent back to the calling method.

(Multiple Choice)
4.8/5
(31)

You indicate that a method parameter is an array by placing ____ after the data type in the method's parameter list.

(Multiple Choice)
4.9/5
(37)

To more easily incorporate methods into a program, it is common practice to store methods in their own classes and files. Then you can add them into any application that uses them. The resulting compound program is called a(n) ____.

(Multiple Choice)
4.8/5
(37)

Arrays, like all objects, are passed by value.

(True/False)
4.8/5
(42)

What are the two most common accessibility levels in C#?

(Essay)
4.8/5
(35)
Match each item with a statement below:
Receives a copy of the value passed to it
parameter list
Optionally present within parentheses after the method name in a method declaration
value parameter
Can only be used in conjunction with an object
fully qualified name
Correct Answer:
Verified
Premises:
Responses:
Receives a copy of the value passed to it
parameter list
Optionally present within parentheses after the method name in a method declaration
value parameter
Can only be used in conjunction with an object
fully qualified name
One that calls another method
calling method
A method's complete name including its class
nonstatic method
The return type for a method that returns either true or false
local variable
What is received by an invoked method when an object is passed to it by reference
field
This kind of variable is declared within a method and is not known to other methods
bool
A variable declared within a class but outside of the class's methods
object's starting memory address
(Matching)
4.8/5
(42)

If you use the keyword modifier ____, you indicate that a method can be called by referring to the class rather than an object from the class.

(Multiple Choice)
4.8/5
(38)

A declaration for a method that receives two or more arguments must list the type for each parameter separately only if the parameters have different types.

(True/False)
4.8/5
(33)

A method ____________________ is a block of statements that carry out the method's work.

(Short Answer)
4.8/5
(43)

If you create a Click() method that responds to button clicks, it will be ____ by default because it is associated with an object that is a Form .

(Multiple Choice)
4.9/5
(38)

The ____ accessibility modifier limits method access to the class that contains the method.

(Multiple Choice)
4.9/5
(35)

The number of arguments does not need to match the number in the parameter list when you use ____.

(Multiple Choice)
4.9/5
(28)

A formal parameter that receives a copy of the value passed to it is also an example of a(n) ____ parameter.

(Multiple Choice)
4.9/5
(33)

The keyword static is used with Main() methods in console applications because the method is associated with its containing class and not with an object. Why are Form methods, such as a Click() method that responds to button clicks, nonstatic?

(Essay)
4.7/5
(32)

If a method does not return a value, its return type is ____________________.

(Short Answer)
4.8/5
(45)
Showing 1 - 20 of 42
close modal

Filters

  • Essay(0)
  • Multiple Choice(0)
  • Short Answer(0)
  • True False(0)
  • Matching(0)