راکت

Constructors

2 پاسخ

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

ثبت پرسش جدید

پاسخ‌ها

2
علی بیات
علی بیات
@ali.bayat

تخصص: توسعه دهنده ارشد وب

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

تخصص: برنامه نویس

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

شاید پاسخ شما همین‌جا باشد

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

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