Java Control structures or Conditional Statements

SAIROSHNI

CONTROL STRUCTURES:

Control Structures are just a way to specify flow of control in programs.

There are three basic types of flow of control, known as:
Sequence logic, or sequential flow
Selection logic, or conditional flow
Iteration logic, or repetitive flow

TYPES OF CONTROL STRUCTURES:

1.Sequence Logic

Sequential logic as the name suggests follows a serial or sequential flow in which the flow depends on the series of instructions given to the computer. 

2. Selection Logic (Branching)

Selection Logic simply involves a number of conditions which decides one out of several written statements.

a)   If statement

b)   If…else statement

c)   If… else if statement

d)   switch statement


3. Iteration Logic (Looping)

It helps to repeat a statement a certain number of times until the condition is satisfied. 

         for loop

         while loop

         do…while loop


Jumping Statements:


Jumping statements in Java let you move the control of your program to a different area of the code to change the flow of control.

  • Break
  • Continue



Our website uses cookies to enhance your experience. Learn More
Accept !

GocourseAI

close
send