Object-oriented programming: what does “.” do?

Tutoring coding, operators come up. The tutor mentions the dot.

From a top-down point of view, the . (aka, dot) operator sets the context wherein you want to refer. Therefore,

obj0.helloWorld();

means “I want to execute the method helloWord() that is part of the obj0 object.”

Object-oriented languages such as Java and Python use dot notation in this way.

Source:

builtin.com

Jack of Oracle Tutoring by Jack and Diane, Campbell River, BC.

Leave a Reply