C# Programming - Functions and Subroutines - Discussion

Discussion Forum : Functions and Subroutines - General Questions (Q.No. 3)
3.
Which of the following statements are correct?
  1. An argument passed to a ref parameter need not be initialized first.
  2. Variables passed as out arguments need to be initialized prior to being passed.
  3. Argument that uses params keyword must be the last argument of variable argument list of a method.
  4. Pass by reference eliminates the overhead of copying large data items.
  5. To use a ref parameter only the calling method must explicitly use the ref keyword.
1, 2
2, 3
3, 4
4, 5
None of these
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
2 comments Page 1 of 1.

Kushal Ramesh said:   8 years ago
An argument passed to a ref parameter need not be initialized first.

Variables passed as out arguments need to be initialized prior to being passed.

Even these statements are true.

Anamika said:   1 decade ago
The params keyword lets you specify a method parameter that takes a variable number of arguments.

You can send a comma-separated list of arguments of the type specified in the parameter declaration, or an array of arguments of the specified type. You also can send no arguments.

No additional parameters are permitted after the params keyword in a method declaration, and only one params keyword is permitted in a method declaration.

Post your comments here:

Your comments will be displayed after verification.