© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2024
J. FriesenLearn Java Fundamentalshttps://doi.org/10.1007/979-8-8688-0351-2_4

4. Statements

Jeff Friesen1  
(1)
Dauphin, MB, Canada
 

Computer programs perform tasks via statements. This chapter introduces you to statements in terms of assignment statements, decision statements, loop statements, loop-branching statements, and additional statements.

Introducing Statements

A statement is a syntactic unit that expresses some action to be carried out. Statements are used to assign values to variables, control the flow of execution by making decisions and repeating other statements a specific number of times or indefinitely, and carry out other tasks.

Statements can be ...

Get Learn Java Fundamentals: A Primer for Java Development and Programming now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.