void TimeTravel (String Doctor) { Doctor = \"Who\"; } String TARDIS; TimeTravel(
ID: 3725605 • Letter: V
Question
void TimeTravel (String Doctor)
{
Doctor = "Who";
}
String TARDIS;
TimeTravel(TARDIS);
What is the value of TARDIS at the end of this code segment? and why?
Answers:
null
the address of Doctor
Who
impossible to determine based on the information given
void TimeTravel (String Doctor)
{
Doctor = "Who";
}
String TARDIS;
TimeTravel(TARDIS);
What is the value of TARDIS at the end of this code segment? and why?
Answers:
null
the address of Doctor
Who
impossible to determine based on the information given
Explanation / Answer
void TimeTravel (String Doctor) // Here called function is not a pointer data
Doctor = "Who"; // Doctor variable contains who
String TARDIS; // Here we can only declare TARDIS, so it contains null
TimeTravel(TARDIS); // After calling TARDIS is not effected because it is not call by reference approach.
Option 1 correct.
void TimeTravel (String Doctor) // Here called function is not a pointer data
Doctor = "Who"; // Doctor variable contains who
String TARDIS; // Here we can only declare TARDIS, so it contains null
TimeTravel(TARDIS); // After calling TARDIS is not effected because it is not call by reference approach.
Option 1 correct.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.