[Interview Question] What is object-oriented programming?
Organizing interview questions about object-oriented programming
in
Yesterday, while interviewing for a job at a major company, I had a situation where I had to answer a question about object-oriented programming that I thought I knew and had organized, but when it came time to answer, I stumbled over it.
Thanks to this, I thought I had pointed out my weaknesses and decided to take the time to reorganize!
What is a ### object?
Let's start with a general definition
General theory: something that actually exists Computer science: Something created in memory as defined by a class.
Object-oriented languages define the following
Java: an instance of a class or an array Python: data that has a property value or behavior.
Classes in Java are not instances, but classes in Python are.
Object-oriented programming
Building interactive programs by defining the roles and relationships of objects.
We can define it like this.
Characteristics of object-oriented languages
abstraction
-
Able to derive common features between objects
-
The part that defines the class is
Polymorphism
-
Can be called the same for functions that behave in slightly different ways
-
Passing interpretation to linked objects for the same command
-
Override (overriding internal sources), overload (calling another function with the same name based on parameters)
Encapsulation
-
You can hide the parts of your implementation without exposing them to the outside world
-
If you need to communicate with the outside world, send and receive information via methods
Inherit from ####
-
The inheritance of features from one class by another class
-
Allows you to create new classes in addition to those already created
댓글 작성
게시글에 대한 의견을 남겨 주세요.