Cohorts
  • Discover
  • About Us
  • Blog
  • Patika.dev
  • Web3

C# 101

Programlama Dillerinin Tarihçesi
C# Tanıtımı

Dotnet 5 Kurulumu
VS Code Kurulumu

Main Methodu - Namespace kavramı - System Using Direktifleri - Run

Değişkenler ve Veri Tiplerleri

Operatorler

Tip Dönüşümleri

Try Catch Finally ve Mantıksal Hatalar
Debugging, Watch ve Variables Pencereleri

If-ElseIf-Ternary-If
Switch-Case

For Loop ve Break Continue Ifadeleri
While Foreach

Tanımlama, Erişim ve Döngülerle Dizi Kullanımı
Array Sınıfı Methodları

Metot Tanımlama
Metot Overloading
Rekürsif ve Extension Metotlar

Algoritma Soruları

String Metotlar
Datetime ve Math Sınıfları

Koleksiyonlar Nedir? Avantajları ve Dezavantajları Nelerdir?
Generic Koleksiyonlar ve List
ArrayList
Dictionary

Koleksiyonlarla ilgili algoritma soruları

Sınıf Nedir ? Instance, Field, Property
Erişim Belirleyiciler ve Kurucu Fonksiyonlar
Encapsulation ve Property Kavramı
Static Sınıf ve Üyeler
Struct(Yapı) Kavramı
Enum

Object Orientented Programming ve Prensipleri Nedir?
Inheritance
Polymorphism ve Sealed Class
Interface
Abstract Class

Telefon Rehberi Uygulaması

ToDo Uygulaması

Switch-Case Yapısı

Switch-Case deyimi if-else deyimleri gibi karar kontrol yapılarıdır. Switch-Case ifadeleri yapabileceğiniz her şeyi if-else blokları ile de yapabiliriz. Bir ifade üç veya daha fazla koşula göre ayrıştırıldığında genel olarak if-else'e alternatif olarak switch case kullanılır.

Örnek bir switch-case ifadesi :

switch(degisken)
{
    case sabit1:
        komutlar;
        break;
    case sabit2:
        komutlar;
        break;
    case sabit3:
        komutlar;
        break;
    default:
        komutlar;
        break;
}

Yukarıdaki örnekte, değişken adıyla girdi alınan veri kontrol edilir. Eğer değişken sabit1'e eşit ise bazı komutlar çalıştırılır ve switch ifadesi sonlandırılır.

Bir koşul sağlandığında gerekli komutlar çalıştırıldıktan sonra break; ifadesi ile kontrol sonlandırılır. Bu demek oluyor ki her case ifadesi birbirinden farklı olmalıdır. Ve bir switch-case ifadesinde yalnızca bir case çalışmalıdır.

Peki kontrol edilen değişken hiçbir sabit ifadeye eşit değilse ne olacak ? Tam da bu noktada default case'ini görüyoruz. Bu durumda kod default kısmında belirtilen kod bloğunu çalıştırır.

Switch-Case ifadelerinde dikkat edilmesi gereken durumlar aşağıdaki gibidir:

  • Case ifadelerinin sırası önemli değildir.
  • Bilinenin aksine default ifadesi en son yazılmak zorunda değildir.
  • Default ifadesi zorunlu değildir. Yazılmasa da olur.

Ödev

Submit your work to complete this lesson.

Join the project workspace to share your solution and receive feedback.

Quiz

Answer the questions to check your understanding.

This lesson includes a short quiz.

Previous
Next

Lesson discussion

Swap insights and ask questions about “C# 101”.

Enroll to participate
Start the course to unlock the discussion. Enrolling helps us keep conversations relevant to learners.
Cohorts
WebsiteDiscoverBlogPatika.devRise In
CoursesCircleRustSoliditySolanaWeb3 FundamentalsBlockchain Basics
CompanyAbout UsTerms of UsePrivacy PolicyGDPR NoticeCookies
Don't miss any update!

Disclaimer: The information, programs, and events provided on https://cohorts.patika.dev is strictly for upskilling and networking purposes related to the technical infrastructure of blockchain platforms. We do not provide financial or investment advice, nor do we make any representations regarding the value, profitability, or future price of any blockchain or cryptocurrency. Users are encouraged to conduct their own research and consult with licensed financial professionals before engaging in any investment activities. https://cohorts.patika.dev disclaims any responsibility for financial decisions made by users based on the information provided here.

© 2026 Cohorts, All rights reserved