What Will Be The Output If All Necessary Code Is Included #1122
What will be the output if all necessary code is included (Header files and main function)?</p> <pre><code class="language-cpp"> void test (Object &y) { y = "It is a string"; } void main() { Object x = null; test (x); System.out.println (x); } </code></pre>
This multiple choice question (MCQ) is related to the book/course
gs gs111 OOP Object Oriented Programming Java.
It can also be found in
gs gs111 Assigning Object, Pointer to Objects, Passing and Returning Object - OOPs MCQ: Passing Object to Functions - Quiz No.2.
What will be the output if all necessary code is included (Header files and main function)?
void test (Object &y) { y = "It is a string"; } void main() { Object x = null; test (x); System.out.println (x); }
Run time error
Compile time error
Null
It is a string