Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Class notes

Study Note on Java - Decision Making & Branching

Rating
-
Sold
-
Pages
7
Uploaded on
28-02-2022
Written in
2021/2022

Study Note on Java - Decision Making & Branching

Institution
Course

Content preview

Chapter 6: Decision making and Branching
6.1 Introduction
 When a program breaks the sequential flow and jumps to another part of the code, it is
called branching.
 When the branching is based on a particular condition, it is known as conditional
branching.
 If branching takes place without any decision, it is known as unconditional branching.
 Java language possesses such decision-making capabilities and supports the following
statements known as control or decision-making statements.
1. if statement
2. switch statement
3. conditional operator statement

6.2 Decision Making with IF Statement
 is a two-way decision statement
 The general form is:
if (test condition)
 Allows the computer to evaluate the expression first and then depending on whether
the value of the expression is true or false, it transfers the control to a particular statement.




Test False
Condi
tion



True




6.3 Simple IF Statement
 The general form of a simple if statement is
if ( test expression)
{
Statement- block;
}
Statement-x;
 Statement-block may be a single statement or a group of statements.
 If the test expression is true, the statement-block will be executed
 Otherwise the statement-block will be skipped and the execution will jump to the
statement-x.

, Test True
Condi
tion




False




6.4 The IF… ELSE Statement




True False
Test
Condi
tion




 The general form is:

Connected book

Written for

Institution
Course

Document information

Uploaded on
February 28, 2022
Number of pages
7
Written in
2021/2022
Type
Class notes
Professor(s)
Mrs. prabitha
Contains
Chapter 6

Subjects

$7.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller
Seller avatar
sinithomas

Also available in package deal

Get to know the seller

Seller avatar
sinithomas Study Notes
Follow You need to be logged in order to follow users or courses
Sold
-
Member since
4 year
Number of followers
0
Documents
10
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions