C++ Programming - Objects and Classes - Discussion

Discussion :: Objects and Classes - General Questions (Q.No.4)

4. 

Which of the following two entities (reading from Left to Right) can be connected by the dot operator?

[A]. A class member and a class object.
[B]. A class object and a class.
[C]. A class and a member of that class.
[D]. A class object and a member of that class.

Answer: Option D

Explanation:

No answer description available for this question.

Bhagchand said: (Aug 24, 2012)  
Because object of that class provide facility to access value of variable that declare in class by DOT(.) operator
Ex:- class sum
{
int a,b;
sum(int x,int y)
{
this.a=x;//(.)DOT operator between object and member of that class
this.b=y;
}
here this is object of current class

Anita said: (Aug 8, 2013)  
A class object and a member of that class can be connected by dot operator because the value of the variable that is declared in that class can be accessed by the object of that class.

Akhila S said: (Sep 6, 2015)  
The dot operator applied to actual object, so class object and a member of that class can be connected by dot operator.

Naina Sharma said: (Sep 10, 2015)  
A class object and member of that class can be dot operator because the value of the variable that is declared in that class accessed of by dot operator.

Prashant Patel said: (Sep 17, 2015)  
What about the static member I mean System.out?

Static member can also be associated with this operator. Thus making option C potential candidate.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.