Question 30Asked in DSSSB TGT Computer Science (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

What does the below code snippet represent? myObject.doActivity();

What does the below code snippet represent? myObject.doActivity();
  1. ACalling a method named doActivity on the object myObject
  2. BSending a message to the doActivity class
  3. CCreating an object myObject
  4. DSending a message to the child class of myObject
Show answerHide answer

Correct answer: (A) Calling a method named doActivity on the object myObject

Explanation

The dot operator calls the method doActivity() on the object myObject (in OOP terms, sends the message doActivity to that object).

From DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM)

This is question 30 of DSSSB TGT Computer Science PYQ (Technical), 12 Sep 2025, Shift 1 (9:00 AM). See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.