Ict 03 Voyager
Ict 03 Voyager
Statements and
Arrays
GROUP 03
What is a control flow
statement
• Control flow refers to the order in
which the instructions of a
program are executed. It
determines how a program moves
from one statement to another,
Control Flow Statement
• Control flow statements are fundamental
components of programming languages
that allow developers to control the order in
which a program's instructions are
executed. They enable developers to:
• Execute a block of code multiple times
Jump Statements
o Syntax:
break;
Use Break Statement
o We can use Java break statement in
all types of loops such as
• For loop,
• while loop and
• do-while loop.
o Syntax:
break;
Break Statement with Loop
break Statement with while loop
Break Statement with do-while
loop
Break Statement with Inner Loop
• It breaks inner loop only if you use
break statement inside the inner
loop.
Continue Statement
• The continue statement is used in loop control
structure when you need to jump to the next iteration
of the loop immediately. It can be used with for loop
or while loop.
• Single
Dimensional
Array
Single-Dimensional Array
• A single-dimensional array in Java is
a linear collection of elements of the
same data type. It is declared and
instantiated using the following
syntax:
Single-Dimensional Array
Multidimensional Array
• A multidimensional array in Java is
an array of arrays where each
element can be an array itself. It is
useful for storing data in row and
column format.
• Syntax to Declare Multidimensional
Array in Java
Multidimensional Array example
Thank
you!
10 VOYAGER