Home »
MCQs »
C# MCQs
Which operator is used to access variables/fields inside a class in C#?
73. Which operator is used to access variables/fields inside a class in C#?
- Arrow Operator (->)
- Dot Operator (.)
- Greater Than (>)
- Dot and Greater Than (.>)
Answer: B) Dot Operator (.)
Explanation:
The dot (.) symbol (or dot operator) is used to access variables/fields in a class in C#.
Syntax:
Class_Name.Variable_Name/Field_Name;