Learn about Class, Object and Instance in object-oriented programming
In the framework of this article, we will take a look at some really basic concepts in object-oriented programming (OOP) that learners need to understand, thereby understanding how the Class works. and wider is how OOP works.
The truth is that the disjoint between the philosophical aspect of development and the actual mechanical activities of computers in object-oriented programming often creates confusion.These two concepts can be distinguished as follows:
The basic concept of OOP is: Class >> Object >> Instance.
Class is like a blueprint.Objects are real objects built on this design (like a house).The instance is a virtual (non-real) copy of Object.
The following sentences often cause confusion for learners by the terms being mixed and combined together in non-intuitive ways:
The first argument that init () receives is used to denote the instance object.
But it is much easier to understand if you interpret the sentence in the following way:
A detailed design for the house is like describing a class. All the houses built on that design are objects of the class. A specific house is an instance.
Finally, try to remember the following when object-oriented programming:
The main difference between a function and a class is: The function is 'floated' comfortably without obstruction.While for Class (instance) must know its parent class (properties of the parent class), so you need to know the methods of reference to the parent class of the class.It is just a small underground rule that you must grasp before going into OOP.Many programming languages use slick syntax instead of simple simplicity, if you are tired of it, you can try Python, this programming language that values simplicity and accessibility for user.
See more:
- Beginners of computer programming need to focus on what?
- 8 websites that help programmers practice coding skills
- Object-oriented programming in PHP
You should read it
- Object-oriented programming in Python
- Learn Class and Object in Python
- Basic Java syntax
- Class (class) and Object in C ++
- Basic C # syntax
- Class (Class) in C #
- Class member functions in C ++
- Objects in JavaScript
- Object-oriented programming in PHP
- What is object-oriented programming? See Steve Jobs's answer!
- Calculate inheritance in C #
- Access Modifier for class in C ++
Maybe you are interested
iPhone XS Max and 6s Plus officially become 'classic' devices
How to decorate a beautiful 20/11 board for the classroom, 20/11 board decoration sample
Some classic Fallout games are free on the Epic Games Store
The 5 best apps and websites to watch classic movies
4 classic Linux tools that have better modern alternatives
Restore classic File Explorer with ribbon in Windows 11