PDA

View Full Version : آموزش: Constructors - آموزش و بحث - منبع Microsoft C# Documentation



niegrua
دوشنبه 16 اردیبهشت 1392, 21:55 عصر
دوستان من میخوام بحث Constructors رو کاملا یاد بگیرم به مرور زمان. و از منبع انگلیسی Microsoft C# Documentation 2012 استفاده می کنم! هر چند وقت یکبار قسمتیش رو پست می کنم و همه با هم میخونیم و و بحث و تمرین کینیم تا خوب یاد می گیریم.

این آموزش شامل:
Using Constructors (C# Programming Guide)

Instance Constructors (C# Programming Guide)

Private Constructors (C# Programming Guide)

Static Constructors (C# Programming Guide)

How to: Write a Copy Constructor (C# Programming Guide)

در قسمت " ابزارهای تاپیک" (سمت بالا - چپ) - تحت نظر گرفتن تاپیک رو انتخاب کنید تا از پست های بعدی باخبر شید.

قسمت آموزشی به زبان انگلیسی هست!

niegrua
دوشنبه 16 اردیبهشت 1392, 21:57 عصر
قسمت اول - مقدمه:

Whenever a class or struct is created, its constructor is called. A class or struct may have multiple constructors that take different arguments. Constructors enable the programmer to set default values, limit instantiation, and write code that is flexible and easy to read.

If you do not provide a constructor for your object, C#‎ will create one by default that instantiates the object and sets member variables to the default values as listed in Default Values Table .

Static classes and structs can also have constructors.