Q:

What will be the output if all necessary code is included (Header files and main function)?

0

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);
}

  1. Run time error
  2. Compile time error
  3. Null
  4. It is a string

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

 (d).It is a string

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

OBJECT ORIENTED PROGRAMMING - OBJECTS AND POINTERS MCQ

This question belongs to these collections

Similar questions


need a help?


find thousands of online teachers now
In which type is new memory location will be alloc... >>
<< If the object is not to be passed to any function ...