Download free for 30 days
Sign in
Upload
Language (EN)
Support
Business
Mobile
Social Media
Marketing
Technology
Art & Photos
Career
Design
Education
Presentations & Public Speaking
Government & Nonprofit
Healthcare
Internet
Law
Leadership & Management
Automotive
Engineering
Software
Recruiting & HR
Retail
Sales
Services
Science
Small Business & Entrepreneurship
Food
Environment
Economy & Finance
Data & Analytics
Investor Relations
Sports
Spiritual
News & Politics
Travel
Self Improvement
Real Estate
Entertainment & Humor
Health & Medicine
Devices & Hardware
Lifestyle
Change Language
Language
English
Español
Português
Français
Deutsche
Cancel
Save
EN
Uploaded by
yatakonakiran2
PPTX, PDF
9 views
Java Flow Controls.pptxJava Flow Controls.pptxJava Flow Controls.pptx
Java Flow Controls.pptxJava Flow Controls.pptx
Education
◦
Read more
0
Save
Share
Embed
Download
Download to read offline
1
/ 30
2
/ 30
3
/ 30
4
/ 30
5
/ 30
6
/ 30
7
/ 30
8
/ 30
9
/ 30
10
/ 30
11
/ 30
12
/ 30
13
/ 30
14
/ 30
15
/ 30
16
/ 30
17
/ 30
18
/ 30
19
/ 30
20
/ 30
21
/ 30
22
/ 30
23
/ 30
24
/ 30
25
/ 30
26
/ 30
27
/ 30
28
/ 30
29
/ 30
30
/ 30
More Related Content
PPTX
Control statements in java
by
Madishetty Prathibha
PPTX
examples of flow controls.pptxexamples of flow controls.pptx
by
kiran kumar
PPTX
control statements
by
Azeem Sultan
PPTX
Control Statements in Java
by
Niloy Saha
PPTX
Programming in java - Concepts- Operators- Control statements-Expressions
by
LovelitJose
PDF
csj-161127083146power point presentation
by
deepayaganti1
PPTX
Lecture - 5 Control Statement
by
manish kumar
PDF
Java Programming - 03 java control flow
by
Danairat Thanabodithammachari
Control statements in java
by
Madishetty Prathibha
examples of flow controls.pptxexamples of flow controls.pptx
by
kiran kumar
control statements
by
Azeem Sultan
Control Statements in Java
by
Niloy Saha
Programming in java - Concepts- Operators- Control statements-Expressions
by
LovelitJose
csj-161127083146power point presentation
by
deepayaganti1
Lecture - 5 Control Statement
by
manish kumar
Java Programming - 03 java control flow
by
Danairat Thanabodithammachari
Similar to Java Flow Controls.pptxJava Flow Controls.pptxJava Flow Controls.pptx
PPT
Control statements
by
raksharao
PDF
Control flow statements in java web applications
by
RajithKarunarathne1
PPT
4.CONTROL STATEMENTS_MB.ppt .
by
happycocoman
PPTX
Control flow statements in java
by
yugandhar vadlamudi
PPT
Control statements in java programmng
by
Savitribai Phule Pune University
PPTX
Loop
by
prabhat kumar
PDF
Java chapter 5
by
Mukesh Tekwani
PPTX
controlStatement.pptx, CONTROL STATEMENTS IN JAVA
by
DrNeetuSharma5
PPTX
Java chapter 3
by
Abdii Rashid
PPT
_Java__Expressions__and__FlowControl.ppt
by
JyothiAmpally
PPTX
6.pptx
by
HarishNayak47
PPTX
Java Control Statements
by
KadarkaraiSelvam
PPTX
Control structures
by
Gehad Enayat
PDF
java notes.pdf
by
RajkumarHarishchandr1
PPTX
Pj01 5-exceution control flow
by
SasidharaRaoMarrapu
PPT
05. Control Structures.ppt
by
AyushDut
PPTX
Flow of control by deepak lakhlan
by
Deepak Lakhlan
PPTX
chapter 8 class 10 icse board notes.pptx
by
Neerajchauhan56039
PPT
Control statements
by
CutyChhaya
PDF
C sharp chap4
by
Mukesh Tekwani
Control statements
by
raksharao
Control flow statements in java web applications
by
RajithKarunarathne1
4.CONTROL STATEMENTS_MB.ppt .
by
happycocoman
Control flow statements in java
by
yugandhar vadlamudi
Control statements in java programmng
by
Savitribai Phule Pune University
Loop
by
prabhat kumar
Java chapter 5
by
Mukesh Tekwani
controlStatement.pptx, CONTROL STATEMENTS IN JAVA
by
DrNeetuSharma5
Java chapter 3
by
Abdii Rashid
_Java__Expressions__and__FlowControl.ppt
by
JyothiAmpally
6.pptx
by
HarishNayak47
Java Control Statements
by
KadarkaraiSelvam
Control structures
by
Gehad Enayat
java notes.pdf
by
RajkumarHarishchandr1
Pj01 5-exceution control flow
by
SasidharaRaoMarrapu
05. Control Structures.ppt
by
AyushDut
Flow of control by deepak lakhlan
by
Deepak Lakhlan
chapter 8 class 10 icse board notes.pptx
by
Neerajchauhan56039
Control statements
by
CutyChhaya
C sharp chap4
by
Mukesh Tekwani
More from yatakonakiran2
PPTX
Operators in c-1.pptxOperators in c-1.pptx
by
yatakonakiran2
PPTX
functions in c-1.pptxfunctions in c-1.pptx
by
yatakonakiran2
PPTX
MULTITHREADING IN JAVAMULTITHREADING IN -1.pptx
by
yatakonakiran2
PPTX
Data-Types-in-C-Programming.Programming.pptxProgramming.pptxpptx
by
yatakonakiran2
PPTX
StringBuffer examples.pptxStringBuffer examples.pptxStringBuffer examples.pptx
by
yatakonakiran2
PPTX
String and StringBufferString and StringBuffer e examples.pptx
by
yatakonakiran2
PPTX
OOP_Java_Part2.pptxOOP_Java_Part1OOP_Java_Part1
by
yatakonakiran2
PPTX
OOP_Java_Part1OOP_Java_Part1OOP_Java_Part1.pptx
by
yatakonakiran2
PPTX
Java_Arrays_Presentation-2aaaaaaaaaa.pptx
by
yatakonakiran2
PPTX
Java_Arrays_Paaaaaaaaaaresentation-1.pptx
by
yatakonakiran2
PPT
Java Fundamentals.pptJava Fundamentals.ppt
by
yatakonakiran2
PPTX
Operating_Systems_UNIT_Concept of an Operating System1.pptx
by
yatakonakiran2
PPTX
array2.pptxarrays conceptsarrays conceptsarrays concepts
by
yatakonakiran2
PPTX
array1.pptarrays conceptsarrays conceptsarrays concepts
by
yatakonakiran2
PPTX
a21.pptxa24.pptxArrays122a24.pptxArrays111
by
yatakonakiran2
PPTX
a1.pptxArrays1Arrays1Arrays1Arrays1Arrays1
by
yatakonakiran2
PPTX
c2ppt.pptxslidenoteseceslidenoteseceslidenoteseceslidenoteseceslidenotesece
by
yatakonakiran2
PPTX
c first pres.pptxslidenoteseceslidenoteseceslidenotesece
by
yatakonakiran2
PPTX
Arrays-from-Basics-to-Advanced final.pptx
by
yatakonakiran2
DOC
CPDS1-8UNITS.docCPDS1-8UNITS.CPDS1-8UNITS.docdoc
by
yatakonakiran2
Operators in c-1.pptxOperators in c-1.pptx
by
yatakonakiran2
functions in c-1.pptxfunctions in c-1.pptx
by
yatakonakiran2
MULTITHREADING IN JAVAMULTITHREADING IN -1.pptx
by
yatakonakiran2
Data-Types-in-C-Programming.Programming.pptxProgramming.pptxpptx
by
yatakonakiran2
StringBuffer examples.pptxStringBuffer examples.pptxStringBuffer examples.pptx
by
yatakonakiran2
String and StringBufferString and StringBuffer e examples.pptx
by
yatakonakiran2
OOP_Java_Part2.pptxOOP_Java_Part1OOP_Java_Part1
by
yatakonakiran2
OOP_Java_Part1OOP_Java_Part1OOP_Java_Part1.pptx
by
yatakonakiran2
Java_Arrays_Presentation-2aaaaaaaaaa.pptx
by
yatakonakiran2
Java_Arrays_Paaaaaaaaaaresentation-1.pptx
by
yatakonakiran2
Java Fundamentals.pptJava Fundamentals.ppt
by
yatakonakiran2
Operating_Systems_UNIT_Concept of an Operating System1.pptx
by
yatakonakiran2
array2.pptxarrays conceptsarrays conceptsarrays concepts
by
yatakonakiran2
array1.pptarrays conceptsarrays conceptsarrays concepts
by
yatakonakiran2
a21.pptxa24.pptxArrays122a24.pptxArrays111
by
yatakonakiran2
a1.pptxArrays1Arrays1Arrays1Arrays1Arrays1
by
yatakonakiran2
c2ppt.pptxslidenoteseceslidenoteseceslidenoteseceslidenoteseceslidenotesece
by
yatakonakiran2
c first pres.pptxslidenoteseceslidenoteseceslidenotesece
by
yatakonakiran2
Arrays-from-Basics-to-Advanced final.pptx
by
yatakonakiran2
CPDS1-8UNITS.docCPDS1-8UNITS.CPDS1-8UNITS.docdoc
by
yatakonakiran2
Recently uploaded
PPTX
Nature, definition and Scope of Indian Knowledge system
by
Banaras Hindu University
PPTX
Chemical Properties of Construction Materials
by
Mrunali Vasava
PPTX
Price Comparison of Product in Odoo 19 Purchase
by
Celine George
PDF
History of Department of AIHC and Archaeology_BHU
by
Banaras Hindu University
PDF
'25 BC An Hour with Bonner Alumni–Meet, Mingle, Move.pdf
by
Bonner Foundation
PPTX
Common problems or challenges faced by Indian adolescents
by
Dr. Harpal Kaur
PPTX
SCOPE OF NURSING. pptx
by
AneetaSharma15
PDF
Slit lamp parts 2/ppt/notes/download.pdf
by
anmols3059
PPTX
Addition_and_Subtraction_of_Radicals_Worksheet.pptx
by
KennMyreenRosas
PDF
Slit lamp parts 1/ppt/pdf/notes/save.pdf
by
anmols3059
PDF
Transformation Framework for Transitioning Traditional Universities to Online...
by
Leonel Morgado
PPTX
Hudson Vitale "AI Essentials: From Tools to Strategies: A 2025 NISO Training ...
by
National Information Standards Organization (NISO)
PPTX
Historical Development and Evolution of Indian Knowledge system
by
Banaras Hindu University
PPTX
PACKAGING MATERIALS Chapter 2 D.Pharm 1st year
by
SharibJamal
PPTX
Staircase: Types, Design & Indian Standards
by
Mrunali Vasava
PPTX
Single entry System Vs Double entry System.pptx
by
lavanyafranklin0804
PDF
Retinal anatomy and physiology/ppt/ .pdf
by
anmols3059
PPTX
THERAPEUTIC ENVIORNMENT.............pptx
by
AneetaSharma15
PPTX
Welcome to our Open Evening 2025 Ballinrobe CS
by
jacollins1515
DOCX
Extension Education: From theory to practice by Dr Subin K Mohan.docx
by
DrSubinKMohan
Nature, definition and Scope of Indian Knowledge system
by
Banaras Hindu University
Chemical Properties of Construction Materials
by
Mrunali Vasava
Price Comparison of Product in Odoo 19 Purchase
by
Celine George
History of Department of AIHC and Archaeology_BHU
by
Banaras Hindu University
'25 BC An Hour with Bonner Alumni–Meet, Mingle, Move.pdf
by
Bonner Foundation
Common problems or challenges faced by Indian adolescents
by
Dr. Harpal Kaur
SCOPE OF NURSING. pptx
by
AneetaSharma15
Slit lamp parts 2/ppt/notes/download.pdf
by
anmols3059
Addition_and_Subtraction_of_Radicals_Worksheet.pptx
by
KennMyreenRosas
Slit lamp parts 1/ppt/pdf/notes/save.pdf
by
anmols3059
Transformation Framework for Transitioning Traditional Universities to Online...
by
Leonel Morgado
Hudson Vitale "AI Essentials: From Tools to Strategies: A 2025 NISO Training ...
by
National Information Standards Organization (NISO)
Historical Development and Evolution of Indian Knowledge system
by
Banaras Hindu University
PACKAGING MATERIALS Chapter 2 D.Pharm 1st year
by
SharibJamal
Staircase: Types, Design & Indian Standards
by
Mrunali Vasava
Single entry System Vs Double entry System.pptx
by
lavanyafranklin0804
Retinal anatomy and physiology/ppt/ .pdf
by
anmols3059
THERAPEUTIC ENVIORNMENT.............pptx
by
AneetaSharma15
Welcome to our Open Evening 2025 Ballinrobe CS
by
jacollins1515
Extension Education: From theory to practice by Dr Subin K Mohan.docx
by
DrSubinKMohan
Java Flow Controls.pptxJava Flow Controls.pptxJava Flow Controls.pptx
1.
Flow Control Statements © 2017
wipro.co confidentia 1
2.
Agenda Flow Control © 2017
wipro.co confidentia 2
3.
Flow Control © 2017
wipro.co confidentia 3
4.
Control Statements © 2017
wipro.co confidentia 4 Control statements are statements which alter the normal execution flow of a program There are three types of Control Statements in java Selection statement Iteration Statement Jumping Statement if if – else switch while for do – while break continu e return
5.
Simple if statement syntax
: if(boolean expression) { statement–block; } Next statement; boolean expression ? True Entry False Next Statement statement–block © 2017 wipro.co confidentia 5
6.
If - Example /*
This is an example of a if statement */ public class Test { public static void main(String args[]) { int x = 5; if( x < 20 ) { System.out.print("This is if statement"); } } } Output: This is if statement © 2017 wipro.co confidentia 6
7.
If..else statement The if….else
statement is an extension of simple if statement Syntax: if(boolean expression) { True-block statements; } else { False-block statements; } Next statement; Boolean expression? True-block False-block Next Statement Entry © 2017 wipro.co confidentia 7 True False
8.
If – else
Example © 2017 wipro.co confidentia 8 /* program to check given age input is eligible to vote or not using if- else*/ public class Check { public static void main(String[ ] args) { int age; age = Integer.parseInt(args[0]); if(age>18) { System.out.println("Eligible to vote"); } else { System.out.println("Not eligible to vote"); } }
9.
Cascading if- else ©
2017 wipro.co confidentia 9 Syntax: if (condition1) { statement-1 } …. else if(conditio-n) { statement-n } else { default statement } next statement
10.
else - if
Example © 2017 wipro.co confidentia 10 /* program to print seasons for a month input using if & else if */ public class ElseIfDemo { public static void main(String[] args) { int month = Integer.parseInt(args[0]); if(month == 12 || month == 1 || month == 2) System.out.println("Winter"); else if(month == 3 || month == 4 || month == 5) System.out.println("Spring"); else if(month == 6 || month == 7 || month == 8) System.out.println("Summer"); else if(month == 9 || month == 10 || month == 11) System.out.println("Autumn"); else System.out.println("invalid month"); } } If args[0] is 6 then the Output is : Summer
11.
Switch Case © 2017
wipro.co confidentia 11 The switch-case conditional construct is a more structured way of testing for multiple conditions rather than resorting to a multiple if statement Syntax: switch (expression) { case value-1 : case-1 block break; case value-2 : case-2 block b reak; default : default block break; } statement-x;
12.
Switch Case -
Example /* This is an example of a switch case statement*/ public class SwitchDemo { public static void main(String[] args) { int weekday = Integer.parseInt(args[0]); switch(weekday) { case 1: case 2: case 3: case 4: case 5: case 6: case 7: default: System.out.println(“Sunday"); break; System.out.println(“Monday"); break; System.out.println(“Tuesday"); break; System.out.println(“Wednesday"); break; System.out.println(“Thursday"); break; System.out.println(“Friday"); break; System.out.println(“Saturday"); break; System.out.println(“Invalid day"); } } } If args[0] is 6 then the Output is : Friday © 2017 wipro.co confidentia 12
13.
While loop Syntax while(condition) { Body
of the loop } tru e Boolean Condition true Body of the loop false © 2017 wipro.co confidentia 13
14.
while loop –
Example /* This is an example for a while loop */ public class Sample{ public static void main(String[] args) { int i = 0; while (i < 5) { System.out.println("i: "+i); i = i + 1; } } } Output: i: 0 i: 1 i: 2 i: 3 i: 4 © 2017 wipro.co confidentia 14
15.
do-while loop Syntax: do { Body
of the loop } while(boolean expression); false tru e Boolean expression Body of the loop © 2017 wipro.co confidentia 15
16.
do…while loop –
Example /* This is an example of a do-while loop */ public class Sample { public static void main(String[] args) { int i =5; do { Syste m.out .prin tln(" i: "+i); i = i } } Output: i: 5 © 2017 wipro.co confidentia 16
17.
For loop © 2017
wipro.co confidentia 17 Syntax for(initialization;condition;increment/decrement) { Body of the loop }
18.
For loop -
Example /* This is an example of a for loop */ public class Sample { public static void main(String[] args) { for (int i=1; i<=5; i++ ) { System.out.println("i: "+i); } } } Output: i: 1 i: 2 i: 3 i: 4 i: 5 © 2017 wipro.co confidentia 18
19.
Enhanced for loop ©
2017 wipro.co confidentia 19 Syntax: for(declaration : expression) { Body of loop }
20.
Enhanced for loop
- Example /* This is an example of a enhanced for loop */ public class Sample { public static void main(String[] args) { int [] numbers = {10, 20, 30, 40, 50}; for(int i : numbers ) { System.out.println( "i: "+i ); } } } Output : i:10 i:2 0 i: 30 i:40 i:50 © 2017 wipro.co confidentia 20
21.
break statement © 2017
wipro.co confidentia 21 While the execution of program, the break statement will terminate the iteration or switch case block When a break statement is encountered in a loop, the loop is exited and the program continues with the statements immediately following the loop When the loops are nested, the break will only terminate the corresponding loop body
22.
break - Example /*
This is an example of a break statement */ public class Sample{ public static void main(String[] args) { for (int i=1; i<=5; i++ ) { if(i==2) break; System.out.println("i: "+i); } } } Output : i: 1 © 2017 wipro.co confidentia 22
23.
continue statement © 2017
wipro.co confidentia 23 The continue statement skips the current iteration of a loop In while and do loops, continue causes the control to go directly to the test-condition and then continue the iteration process In case of for loop, the increment section of the loop is executed before the test- condition is evaluated
24.
© 2017 wipro.co
confidentia 24 Continue - Example /* This is an example of a continue loop */ public class Sample { public static void main(String[] args) { int [] numbers = {1, 2, 3, 4, 5}; for(int i : numbers ) { if( i == 3 ) { continue; } System.out.println( "i : "+i ); } } } Output : i: 1 i:2 i:4 i:5
25.
© 2017 wipro.co
confidentia 25 if statement Always use {} for if statements Avoid the following error prone if (condition) statement; switch-case statement Number per Line //ERROR One declaration per line is recommended int height; int width; is preferred over int height,width; Do not put different types on the same line Good Programming Practices
26.
What will be
the result, if we try to compile and execute the following code ? class Sample{ public static void main(String[]args) { boolean b = true; if(b){ System.out.println(" if block "); } else { System.out.println(“ else block "); } } } © 2017 wipro.co confidentia 26 Quiz
27.
What will be
the result, if we try to compile and execute the following code snippets 1. class Sample { public static void main(String[] args) { while(false) System.out.println("while loop"); } } 2. class Sample { public static void main(String[] args) { for( ; ; ) System.out.println("For loop"); } } © 2017 wipro.co confidentia 27 Quiz (Contd.).
28.
© 2017 wipro.co
confidentia 28
29.
In this session,
you were able to : Learnt the various Flow control statements © 2017 wipro.co confidentia 29 Summary
30.
Thank You © 2017
wipro.co confidentia 30
Download