ISDS 505 Final Ch 8 (with 100% Correct Answers)
A mandatory parameter ______________________. a. requires an argument to be sent from a method call b. is any argument sent to a method c. is preceded by the keyword man d. All of the above are true. correct answers a. requires an argument to be sent from a method call Which is not a type of method parameter in C#? a. value b. forensic c. reference d. output correct answers b. forensic Which type of method parameter receives the address of the variable passed in? a. a value parameter b. a reference parameter c. an output parameter d. two of the above correct answers d. two of the above When you declare a value parameter, you precede its name with ______________________. a. nothing b. a data type c. the keyword val and a data type d. the keyword ref and its data type correct answers b. a data type Assume that you declare a variable as int x = 100; and correctly pass it to a method with the declaration private static void IncreaseValue(ref int x). There is a single statement within the IncreaseValue() method: x = x + 25;. Back in the Main() method, after the method call, what is the value of x? a. 100 b. 125 c. It is impossible to tell. d. The program will not run. correct answers b. 125 Assume that you declare a variable as int x = 100; and correctly pass it to a method with the declaration private static void IncreaseValue(int x). There is a single statement within the IncreaseValue() method: x = x + 25;. Back in the Main() method, after the method call, what is the value of x? a. 100 b. 125 c. It is impossible to tell. d. The program will not run. correct answers a. 100 A reference parameter differs from an output parameter in that a reference parameter ______________________ but an output parameter does not. a. receives a memory address b. occupies a unique memory address c. requires an initial value d. must be a simple data type correct answers c. requires an initial value
Geschreven voor
- Instelling
- ISDS 505
- Vak
- ISDS 505
Documentinformatie
- Geüpload op
- 5 april 2024
- Aantal pagina's
- 3
- Geschreven in
- 2023/2024
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
Ook beschikbaar in voordeelbundel