Dart - Condition & Loop

2023. 5. 5. 17:04·📘 Frontend/Dart

Java & Kotlin과 동일한 내용은 안쓰고 새로운 내용만 작성


If & Switch

  • If문은 자바와 동일하다.
  • Switch문도 Java와 같이 case: , default 동일하게 사용한다.

Loop

For

  • 자바의 For문과 코틀린의 in For문 둘 다 가능하다.
List<int> numbers = [1, 2, 3, 4, 5]

for (int i=0; i< numbers.length; i++) {
  total += numbers[i]
}

for (int number in numbers) {
  total += number;
}

While

  • While, do-While 모두 자바와 동일하다.

Break & Continue

  • 다른 언어와 동일하다.

Enum

  • Enum도 자바와 동일하다.
enum Status{a,b,c}
저작자표시 (새창열림)

'📘 Frontend > Dart' 카테고리의 다른 글

Dart - Inheritance & Interface & Generic  (0) 2023.05.06
Dart - Constructor & Getter & Private  (0) 2023.05.06
Dart - Funtion  (0) 2023.05.05
Dart - Operator & List & Map & Set  (0) 2023.05.05
Dart - Type & Null & Immutable  (0) 2023.05.05
'📘 Frontend/Dart' 카테고리의 다른 글
  • Dart - Constructor & Getter & Private
  • Dart - Funtion
  • Dart - Operator & List & Map & Set
  • Dart - Type & Null & Immutable
신건우
신건우
조용한 개발자
  • 신건우
    우주먼지
    신건우
  • 전체
    오늘
    어제
    • 분류 전체보기 (422)
      • 📘 Frontend (71)
        • Markup (1)
        • Style Sheet (2)
        • Dart (8)
        • Javascript (12)
        • TypeScript (1)
        • Vue (36)
        • React (2)
        • Flutter (9)
      • 📘 Backend (143)
        • Java (34)
        • Concurrency (19)
        • Reflection (1)
        • Kotlin (29)
        • Python (1)
        • Spring (42)
        • Spring Cloud (5)
        • Message Broker (5)
        • Streaming (2)
        • 기능 개발 (5)
      • 💻 Server (6)
        • Linux (6)
      • ❌ Error Handling (11)
      • 📦 Database (62)
        • SQL (31)
        • NoSQL (2)
        • JPQL (9)
        • QueryDSL (12)
        • Basic (4)
        • Firebase (4)
      • ⚙️ Ops (57)
        • CS (6)
        • AWS (9)
        • Docker (8)
        • Kubernetes (13)
        • MSA (1)
        • CI & CD (20)
      • 📚 Data Architect (48)
        • Data Structure (10)
        • Algorithm (8)
        • Programmers (17)
        • BaekJoon (5)
        • CodeUp (4)
        • Design Pattern (4)
        • AI (0)
      • ⚒️ Management & Tool (8)
        • Git (7)
        • IntelliJ (1)
      • 📄 Document (10)
        • Project 설계 (6)
        • Server Migration (3)
      • 📄 책읽기 (2)
        • 시작하세요! 도커 & 쿠버네티스 (2)
      • 🎮 Game (4)
        • Stardew Vally (1)
        • Path of Exile (3)
  • 블로그 메뉴

    • 링크

      • Github
    • 공지사항

    • 인기 글

    • 태그

      GStreamer #Pipeline
      Lock #Thread #Concurrency
      React #Markdown
    • 최근 댓글

    • 최근 글

    • hELLO· Designed By정상우.v4.10.0
    신건우
    Dart - Condition & Loop
    상단으로

    티스토리툴바