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
May be interested
- What is the basic C ++ programming language?c ++ is a static programming language, data deduction, distinguishing lower case letters that support object-oriented programming, procedural programming.
- Udemy's top 5 JavaScript coursesa programming language that runs on any computer in the world. a language does not need any special software to run. a language ranked among the top in the world.
- Learn about Ethical hacking using Kali Linux and Raspberry Pia raspberry pi 3 runs kali linux for building amazing hacking skills. this small computer is cheap, powerful and very flexible.
- Instructions for installing MySQL on Windows and remote accesssteps to install mysql, the basic settings for you to use mysql on windows as well as access to remote databases will be presented in detail in this article by tipsmake.com. please follow us!
- 8 great CodePen features for programming and web developmentcodepen.io is a programming environment in the browser, designed for both learning code and quickly creating ideas with the least hassle.
- Blockchain programming part 4: Java programming languagethe purpose of this tutorial is to help you build a panoramic view of how people can develop blockchain technology.