LearnFrenzy
Sign in Take a free test

Classes and Objects · Classes and Objects MCQ · Question 4

What does assigning a reference do? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
Question 4 Back to Exercise

After Car b = a;, how many Car objects exist (assuming a referred to one)?

  • A 2
  • B 1 – both variables refer to the same object Correct
  • C 0
  • D It depends
Correct Answer: Option B

Only the reference is copied.

Discussion & Comments 0

Share your method, a shortcut, or ask about a step you didn't follow.

No comments yet. Be the first to share your solution!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links