0% found this document useful (0 votes)
2 views1 page

البرمجة: التغليف والوصول للمتغيرات

Uploaded by

adhamayad000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

البرمجة: التغليف والوصول للمتغيرات

Uploaded by

adhamayad000
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

1 - encapsulation → ‫لما اكون فى كالس و عاوز اعمل تغليف ل متغير محجش يقدر يعمل عليه‬

‫ اكسز بعملو‬encapsulation

int _namecompany = "meta"; → private variable

***********************************************************************************
*******************

2 - get , set → to access the value that we encapsulat it we use get , set is to
change the value of the private variable in the class

class company{
int _name = 5;
get companynameget => _name; // here we using arrow function , in retern we write
the variable that is private and we want to access it
set companyNameSet(int edit) => _name = edit; // edit the value of the private
}

in code.
use get → company.companynameget;
use set → company.companyNameSet = 2;

***********************************************************************************
*******************

3 - abstruct class → ‫كالس نرث منو خصائص وال نستطيع انشاء اوبجكت من خالله‬

***********************************************************************************
*******************

4 - Record → use to return two values or more from methods

Record sum(){

var names = (a:adham , s:samah); // can use key and values

return (name,age);
}

***********************************************************************************
*******************

5 -

You might also like