adplus-dvertising
frame-decoration

Question

Choose the correct type of variable scope for the given defined variables.Scope declaration:
class ABC
  {
      static int m;
      int n;
      void fun (int x , ref int y, out int z, int[] a)
      {
         int j = 10;
      }
  }

a.

m = static variable, n = local variable, x = output parameter, y = reference parameter, j = instance variable, z =output parameter, a[0]= array element

b.

m = static variable, n = instance variable, x = value parameter, y = reference parameter, j = local variable, z =output parameter , a[0] = array element

c.

m = static variable, n = instance variable, x = reference parameter, y = value parameter, j = local variable, z =output parameter, a[0] = array element

d.

m = local variable, n = instance variable, x = reference parameter, y = value parameter, j = static variable, z =output parameter, a[0] = array element

Answer: (b).m = static variable, n = instance variable, x = value parameter, y = reference parameter, j = local variable, z =output parameter , a[0] = array element

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. Choose the correct type of variable scope for the given defined variables.Scope declaration:

Similar Questions

Discover Related MCQs

Q. Scope of variable is related to definition of variable as:

a. Region of code within which variable value is valid and hence can be accessed.
b. No, relation with region where variable is declared its value is valid in entire scope.

Q. Syntax for declaration and initialization of data variable is :

Q. Choose effective differences between ‘Boxing’ and ‘Unboxing’.

Q. Select differences between reference type and value type :

1. Memory allocated to ‘Value type’ is from heap and reference type is from ‘System. ValueType’
2. Memory allocated to ‘Value type’ is from ‘System. ValueType’ and reference type is from ‘Heap’
3. Structures, enumerated types derived from ‘System. ValueType’ are created on stack, hence known as ValueType and all ‘classes’ are reference type because values are stored on heap

Q. What is the need for ‘Conversion of data type’ in C#?

Q. Types of ‘Data Conversion’ in C#?

Q. Implicit Conversion' follows the order of conversion as per compatibility of datatype as :

Q. Subset of ‘int’ datatype is :

Q. Type of Conversion in which compiler is unable to convert the datatype implicitly is ?

Q. Disadvantages of Explicit Conversion are ?

Q. Correct order of priorities are :

Q. The correct way of incrementing the operators are :

Q. Which of the following is/are not Relational operators in C#.NET ?

Q. Select the relevant output for the set of code :

m = 5;
int y;
1. y = m++;
2. y = ++m;

Q. Which of the following options is not a Bitwise Operator in C#?

Q. Which among the following is a conditional operator ?

Q. Arrange the operators in the increasing order as defined in C#:
!=, ?:, &, ++, &&