# Static Members

```aspnet
/*
Örneğin Kayseri adresinde bulunan Erciyes Üniversitesinde ki öğrencilerin
bir class ını oluşturmak istersek adres ve üniversite adı hep aynı kalacak
yalnızca öğrencilere ait bilgiler değişiklik göstereceği için adres ve
üni bilgisi static members olarak tanımlanır. Object üzerinden ulaşılamaz
class a özel tanımlamalardır.
*/

class Student{
        public string Name { get; set; }
        public int Number { get; set; }
        public static string School = "ERÜ";
        public static string Address = "Kayseri";

        public Student(string name, int number)
        {
            this.Name = name;
            this.Number = number;
        }

        public void DisplayDetails(){
            Console.WriteLine($"Adı: {this.Name} / Numara: {this.Number}");
        }

        public static void DisplaySchoolDetails(){
            Console.WriteLine($"Okul Adı: {School} / Okul Adresi: {Address}");
        }
}


var s1 = new Student("Ahmet",001);
var s2 = new Student("Kübra",002);
var s3 = new Student("Adem",003);

Student.DisplaySchoolDetails();
s1.DisplayDetails();
s2.DisplayDetails();
s3.DisplayDetails();
```

## Yukarıdaki bilgilerle bir uygulama yapalım

```aspnet
// Bir cümlenin karakterlerini değiştiren bir uygulama yapalım

static class HelperMethods{
        public static string KarakterDuzelt(string str){
            return str.Replace("ö","Ö")
            .Replace("d","D")
            .Replace("g","ğ")
            .Replace("Ç","ç");
        }
}

string str = "ölÇme ve degerlendirme";
var cikti = HelperMethods.KarakterDuzelt(str);
System.Console.WriteLine(cikti);
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://cnahmet.gitbook.io/asp-net-notlarim/nesne-tabanli-programlama/static-members.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
