Java Basics Practice Test: Control Statements — Flashcards | Java Programming | FatSkills

Java Basics Practice Test: Control Statements — Flashcards

Fast review mode: answers are shown by default so you can skim quickly. Hide them if you want to self-test.

In Java, control statements are used to control the flow of execution in a program. They are used to make decisions, to loop through blocks of code multiple times, and to jump to a different part of the code based on certain conditions.
 

There are three main types of control statements in Java:
Decision-making statements:
These statements allow you to make decisions about which block of code to execute based on a condition. The most common decision-making statements are the if, else if, and else statements.
Looping statements: These statements allow you to execute a block of code repeatedly until a condition becomes false. The most common looping statements are the while, do-while, and for loops.
Jump statements: These statements allow you to jump to a different part of the code based on a condition. The most common jump statements are the break, continue, and return statements.

1 of 20 Ready
Which of these selection statements test only for equality?
switch
Shortcuts
Prev Space Show / hide Next
Turn this into a study set.
Sign in with Google to save tricky questions to your reminder list and resume on any device.
Sign in with Google Free • no extra password