Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python hide details

class MyClass:
    __hiddenVar = 12
    def add(self, increment):
       self.__hiddenVar += increment
       print (self.__hiddenVar)
myObject = MyClass()
myObject.add(3)
myObject.add (8)
print (myObject._MyClass__hiddenVar)
Source by www.tutorialspoint.com #
 
PREVIOUS NEXT
Tagged: #python #hide #details
ADD COMMENT
Topic
Name
5+6 =