🔥یلدا با راکت با (( ۷۰ درصد‌ )) تخفیف! یلدا طولانی است، اما این تخفیف نه.

مشاهده دوره‌ها
ثانیه
دقیقه
ساعت
روز

Constructors

سلام
کسی کاربرد واحد سازنده رو میدونه؟


ثبت پرسش جدید
علی بیات
تخصص : توسعه دهنده ارشد وب
@ali.bayat 5 سال پیش مطرح شد
0

A constructor is a special function of the class that is responsible for initializing the variables of the class. Dart defines a constructor with the same name as that of the class. A constructor is a function and hence can be parameterized. However, unlike a function, constructors cannot have a return type. If you don’t declare a constructor, a default no-argument constructor is provided for you.

وقتی که آبجکتی رو از یک کلاس میسازیم.. constructor فرصت این رو داره که اجرا بشه و جز مفاهیم اولیه شئ گرایی هست. در زبان Dart بر خلاف یک تابع، constructor نمیتونه return type داشته باشه.


سید علیرضا محمد مرادی
تخصص : برنامه نویس
@Alirezamoradi2ns 5 سال پیش مطرح شد
0

یعنی وظیفه اش ساخت default هستش؟
@ali.bayat


برای ارسال پاسخ لازم است وارد شده یا ثبت‌نام کنید

ورود یا ثبت‌نام