Oop

Pages in this section

  • Object
    Last edited: 2023-11-11

    An object keeps data behind an interface. It makes its internal variables private. Then exposes setter functions that allow people to edit in there preferred way. It also has getter functions to provide the methods to get at the data how they would like to access it.

    The following would be a data structure .

    class point:
    	x : float
    	y : float
    
    	def init(self, x: float, y: float):
    		self.x = x
    		self.y = y
    

    Whereas the following would be an object.