diff --git a/4 - Object Oriented Programming/1.1 - Classes and Objects.tex b/4 - Object Oriented Programming/1.1 - Classes and Objects.tex index 87968f3..ed71036 100644 --- a/4 - Object Oriented Programming/1.1 - Classes and Objects.tex +++ b/4 - Object Oriented Programming/1.1 - Classes and Objects.tex @@ -117,6 +117,11 @@ p.printName() \end{lstlisting} The output of this code would be \pigOut{brett}. +You access methods the same way as your would class properties except you include the parenthesis. +You may also notice a reference to a variable \pigVar{this} in the method definition. +This special variable is used within methods to refer to the object that the method belongs to. +So using \pigVar{this} within the method \pigVar{printName} is similar to using the variable \pigVar{p} to access +the specific instance that that method belongs to. \subsection{Special Methods} diff --git a/Programming In General.pdf b/Programming In General.pdf index 042e865..6073f35 100644 Binary files a/Programming In General.pdf and b/Programming In General.pdf differ