4 Working with Decision-making Statement in Java

4.1 INTRODUCTION

Decision-making statements are needed to alter the sequence of statements in a program depending on certain circumstances. In the absence of decision-making statements, a program executes in a serial fashion on statement by statement basis, which have been presented in programs given in earlier chapters. This chapter deals with statements that control the flow of execution on the basis of some decision. All the control flow constructs have their conditions which return Boolean value. Depending on truth or falsity, the decision is taken. Decision can be made on the basis of success or failure of some logical condition. They allow one to control the flow of program. The statements ...

Get Java 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.