If we think the real world, actually everything is an object around us... These objects have some states, behaviours and surely identity. For object oriented programming, same thing is valid about objects.
Every object in OOP has states(what we know about object/ properties/ fields/ variables etc. ), also they have behaviours(what an object can do/ resposibilities/ methods(functions) ), and identity(place in memory/ physical location/ memory address).
Classes
We need a class in order to store objects. Wtihout any class we can not create an object for our project. Classes are blueprint/prototype for creating object.
We define states and behaviours in our classes.
Hiç yorum yok:
Yorum Gönder