-
Object-orientation is about treating an application as a group of "objects" and then programming those objects to make them functional.
You can define an object and have multiple instances of that object. For example, if these number buttons are very similar in function on a calculator in Windows, they may be multiple instances of a large class. Think of a "class" as an object.
-
For example, you have a color TV at home.
The color and size of the color TV are attributes.
string a=house. Living room. TV stand. Tv. Color.
This point is equivalent to the character '的 in Chinese characters, and the scope is limited.
If I have a method called turn on the TV(), this method can turn on the TV.
House. Living room. TV stand. Tv. Turn on the TV ();
Methods must be followed by parentheses.
or House. Living room. TV stand. Tv. close();
For example, your hand was cut with a knife. It bleeds. You're going to have to treat the wound in a way that's like yes.
Treating wounds ();
Above is a method that you want to execute it.
You. Right hand. Treating wounds ();
Actually"instance"It's better to understand.
You've made up some classes. Have you used Flash! You've created a new Ctrl+F8 video clip, what do you have to do if you want to use it on stage?
Drag to the stage! That's why you have to use an object that must be instantiated first.
-
Since we're talking about object orientation, let's talk about previous programming. Previously, programming was process-oriented.
For example, if you want to build a car, the previous process-oriented process can be understood in this way, it will decompose the method of building a car into steps, clear is clear, but if a person wants to change its steps, he will face a problem, maybe after he changes the steps, the car will be wasted and cannot be moved, unless he has the same ability as the original designer, he can deeply understand the various intentions of the original designer.
The object-oriented is different, the designer does not care about the various principles of building a car, he only needs to do one thing, that is, to combine the various parts of the car, for example, he can take the engine made by A, the tire made by B, the steering wheel made by C, etc., of course, it can also be built by himself (if he has the time and ability).
Since anyone can publish objects, and anyone can use objects published by others, object-oriented programming can effectively improve the efficiency of programming and reduce the time of debugging.
-
I'm talking nonsense, you see.
An object is a noun, e.g. cat.
The method is an action, for example: eating.
Attributes are attributes, e.g. color, name.
An instance is a materialization, for example:
Create a new instance My Cat = new Cat.
Define My Cat. Color = Black.
Define My Cat. Name = Baby.
Call My Cat. Eat (mice).
The program runs Black Baby Eats Mouse.
-
If you want to be a master programmer, it's best not to be object-oriented all the time. Because it deprives you of a lot of opportunities to understand the underlying stuff.
-
1. Object-oriented is a software development method. The concept and application of object-oriented has gone beyond programming and software development to include database systems, interactive interfaces, application structures, application platforms, distributed systems, network management structures, CAD technology, artificial intelligence, and other fields. Object-oriented is a method of understanding and abstracting the real world, which is a product of the development of computer programming technology to a certain stage.
2. Object-oriented is relative to process-oriented, object-oriented approach, which organizes relevant data and methods as a whole, and conducts system modeling from a higher level, which is closer to the natural operation mode of things.
A programming approach that treats data types and functions as a whole is called object-oriented. >>>More
I think the way to understand modern poetry is actually to understand some of the author's living background, under normal circumstances, after understanding the author's life background, you can understand what he does, under normal circumstances, people with a better life will not worry about the fate of life, and people with better lives will not sigh about fate, in fact, it all comes from some of the author's own meaning.
The engulfing pattern, also known as the holding pattern, is made up of two **s. Bullish engulfing occurs in a downtrend, where the body of the second white candlestick eats the body of the first black candle; A bearish engulfing occurs in an uptrend where the body of the second black candlestick eats the body of the first white candle. The Engulfing pattern can show the ebb and flow of long and short forces. >>>More
What is love and how to understand it? In fact, love is unclear, confused, love is giving, giving to each other love is for each other's thoughts, for each other's thoughts, love is wholehearted giving, love does not need a reason from the heart.
How to understand the mysteries of the universe?