Site icon TestingDocs.com

Control Structures Overview

Introduction

On this page, we will learn control structures. Control structures are blocks of statements that are executed based on conditions. This is very useful when we make decisions. We can control the flow of the program using control structures and branch base on the conditions.

If-else statement

If-else statement is used for decision making. If the expression is true one set of statement(s) is executed and if the expression id false another set of statement(s) is executed. Java program using the if-else clause statement:

https://www.testingdocs.com/questions/write-a-java-program-with-if-else-statement/

Nested If

Nested if demo java program:

https://www.testingdocs.com/questions/java-program-for-nested_if_statement/

 

Exit mobile version