Kotlin - Control Flow


Advertisements

Kotlin flow control statements determine the next statement to be executed. For example, the statements if-else, if, when, while, for, and do are flow control statements.

Flow Chart for Control Flow

Control flow can be depicted using the following Flow Chart:

Control Flow Chart

Kotlin Control Flow Statements

This tutorial will take you through all these statements one by one explaining their usage and suitable examples.

Quiz Time (Interview & Exams Preparation)

Answer : D

Explanation

All the mentioned statements are correct about control flow.

Q 2 - Which of the following is a control flow statement in Kotlin?

A - String

B - Fun

C - When

D - None of the above

Answer : C

Explanation

Here keyword when is part of the Kotlin Control Flow statements

Q 3 - If we do not have control flow statements, then it will be almost impossible to write a computer program?

A - True

B - False

Answer : A

Explanation

Yes it is true, control flow statements are essential part of any programming languages to write a program.

Useful Video Courses


Video

Kotlin Online Training

68 Lectures 4.5 hours

Arnab Chakraborty

Video

Kotlin Masterclass Programming: Android Coding Bible

Featured

71 Lectures 5.5 hours

Frahaan Hussain

Video

Android Dependency Injection using Dagger with Kotlin

18 Lectures 1.5 hours

Mahmoud Ramadan

Video

Android Retrofit complete course in Kotlin

49 Lectures 6 hours

Catalin Stefan

Video

Master Kotlin - Learn Kotlin to develop android apps

49 Lectures 2.5 hours

Skillbakerystudios

Video

Breeze Music Player - Learn Kotlin, MVVM and MediaPlayer API

22 Lectures 1 hours

CLEMENT OCHIENG

Advertisements