Professional Documents
Culture Documents
SIMPLE STATEMENT
- Basic building blocks of a program.
- One or more lines terminated by a
semicolon (;).
- If
- If-Else
- If-Else-If
- Switch structure
TYPES OF CONTROL STRUCTURES:
Complex Conditionals
IF- ELSE STRUCTURE: EXAMPLE 3
THE IF-ELSE STATEMENT
- The IF/ELSE STATEMENT is an extension
of the if statement. If the statements
in the if statement fails, the
statements in the else bock are
executed.
NESTED IF STATEMENT
LOOP STATEMENT
- Allows us to execute a statement or
group of statements multiple times
and following is the general form of
a loop statement in most of the
programming languages.
BREAK STATEMENT
- Defines the end of a case.
DEFAULT STATEMENT
- Use in defining message to be
displayed that is outside of the given
case.
WHILE
EXCEPTION
DO… WHILE LOOP
- An EXCEPTION is an event, usually
- A DO…WHILE LOOP is similar to a some form of error, which happens
while loop, except that a DO…WHILE during the normal course of program
LOOP is guaranteed to execute at execution. The object-oriented
least one time. technique to manage such errors
comprises the group of methods
DO… WHILE LOOP STATEMENT known as exception handling.
Exception Hierarchy
TYPES OF EXCEPTIONS
THROWS CLAUSE