Kotlin - Nested Branches (중첩 분기문)

CODEDRAGON Development/Kotlin

반응형


 

Kotlin - Nested Branches (중첩 분기문)

·       제어문안에 다른 제어문을 중첩해서 사용할 있습니다.

·       중첩해서 사용할 경우 Nested Depth 늘어나고 프로그램의 복잡도는 증가

하게 됩니다. 그러므로 중첩된 깊이가 낮을 수록 프로그램 성능이나 코드 가독성이 높아지게 됩니다.

 

 

 

if(){

if() {}

}

  

when(target){

value -> { when(){} }

}

 

when(target){

value -> { if(){} }

}

 

 

 

 


반응형

'Development > Kotlin' 카테고리의 다른 글

Single expression  (0) 2018.11.27
Kotlin - continue label 문 형식  (0) 2018.11.26
Kotlin - 함수 형태  (0) 2018.11.24
Kotlin - Bitwise operation (비트 연산자)  (0) 2018.11.23
Kotlin - 기본인수(Default argument)  (0) 2018.11.22