ACtE03 · Chapter 3Programming & Applications🏛️ Past Licensure QuestionID: 256b5f68
The dot operator (.) connects which of the following two entities in C++ / OOP?
The dot operator (.) connects which of the following two entities in C++ / OOP?
Multiple Choice Options
- A
Class member and class object
- B
Class object and a class
- C
Class and member of that class
- D✓ Correct Option
Class object and member of that class
Detailed Technical Solution & Explanation
In object-oriented programming (such as C++ and Java), the dot operator (.) is the direct member selection operator. It is used to access members (data variables or member functions) of a specific instance (class object), written in the format object.member.
Option Analysis:
•
Option A (Class member and class object): Inverted syntactic relationship; the syntax evaluates
object.member, connecting the object on the left to its member on the right.•
Option B (Class object and a class): The dot operator does not connect an object to its class type.
•
Option C (Accessing static members directly through class scope uses the scope resolution operator (
): :), not the dot operator.•
Option D (Class object and member of that class): Correct. The dot operator directly connects an instantiated class object to a member variable or method belonging to that object.
Reference: Mock Test 06NEC Licensure Syllabus