If a method is to be used to enter two values that will be used later in the program,
which of the following would be the most appropriate heading and call?
a. heading: public void InputValues(out int val1, out int val2)
call: InputValues(out val1, out val2);
b. heading: public void InputValues(int val1, int val2)
call: InputValues(val1, val2);
c. heading: public void InputValues(ref int val1, ref int val2)
call: InputValues(ref val1, ref val2);
d. heading: public int int InputValues( )
call: val1 = InputValues( );
val2 = InputValues( );
e. none of the above
The correct answer is: a. heading: public void InputValues(out int val1, out int val2)
call: InputValues(out val1, out val2);
Explanation:
The method heading "void InputValues(out int val1, out int val2)" is used to enter two values that will be used later in the program by call the method InputValues(out val1, out val2);
So, the correct answer is (a).