c# - What is the difference between a namespace, a class, an object and an instance? -


I am first reading C # (this is very interesting and user-friendly), but I wonder what Is there a useful metaphor for describing names, spaces, classes, methods, qualities, etc. all together 'fit'?

Whether a parent is a parent and the law is a child, etc. Or is it more complicated?

A name may be a house, and a classroom can be a room (bathroom) and what can be done in that room (washing, etc.) and the properties that can be What can be done during that activity soap, hot water ...

... I will get my own coat

I will say:

  • Namespace : A category or brand of cars. Note that the brand is not actually deciding how the car has been built. You can not say that a Honda always has four doors, or it is always 4wd. It is up to the classroom to direct such characteristics. Names mention the purpose of the place very well.

  • Class : Blueprint for how to prepare a specific car.

  • Object : An actual car (example) made from a car Blueprint (class)

  • Method : A car user can do this

  • Property : Features, information and building blocks, including cars, start Do (), increase (), break (), opendoor () etc.

    . Like total walking miles, colors, steering wheel dimensions, stereo systems, etc.

Some concepts that you may find more advanced may probably overwork, but if you are interested then read it:

  • Legacy : When a class is based on another class and adds some more specific details. A line of heritage is usually made of the most common and common aspect, all the way under a point where it is not more specific and more specific. Examples of animals in this context: Animal-> Matter-> Rodent-> Rat-> Rtsnorvegicus

  • Set : Properties which "makes" such as "This car is a collection of four wheels, one chassis, one engine etc."

  • Attribute : Properties describing objects, not usually part of their physical creation, such as colors, top speed, engine volume etc.

  • Encapsulation : To prevent the user from concealing certain properties or to use certain properties, (in order to damage the object) Change the gear-property of a car class without any form. You finish it and make sure the clutch () is called before the setgier ().

  • Overriding : If a class is received from another class, then it is basically overriding methods from that class when inheriting < / Em> class replaces the implementation of such a method with its own necessary behavior, example of use in the next point.

  • Polymorphism : A difficult concept to understand until you use it practically. It means referring to a specific type of object, using a general reference, which allows you to ignore specific types (when you do not know it). For example, if you do not want to "read" the property of the license plate number of each vehicle in the parking lot, then you really do not care what the brand is, or even if it is a trailer or motorcycle or whatever To be able to, we ensure that the license plate number is an asset in the most common class in the heritage line (probably the vehicle class). Then you only have to call all those items in a list as a vehicle and then vehicle: GetLicensePlateNumber (). To get the number of vehicles, some special handling is required to get the number, by applying this behavior by overriding this behavior and behaving as needed. Therefore, objects can be used as a wide range of types as they were of the same type but can behave differently


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -