24. Class va Object
Sunnat Qayumov
Posted on October 14, 2024
a) Class ichida methodni qanday deklaratsiya qilasiz?
- Qaytarish turi(return Type)
- Metod nomi
- Parametrlari ro'yxati
-
Method tanasi
class ClassName { // Qaytarish turi, metod nomi va parametrlar public int MyMethod(int param1, string param2) { // Metodning tanasi return result; // Qaytarish qiymati } }
*b) Quyidagi koddagi this kalit so'zining ma'nosini tushuntiring: *
class Person
{
public string Name;
public Person(string name)
{
this.Name = name;
}
}
💖 💪 🙅 🚩
Sunnat Qayumov
Posted on October 14, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
githubcopilot AI Innovations at Microsoft Ignite 2024 What You Need to Know (Part 2)
November 29, 2024