Skip to main content

Java Selection

  • Chapter
Mastering Java

Part of the book series: Macmillan Master Series

Abstract

A decision is made with the if statement. It logically determines whether a conditional expression is TRUE or FALSE. For a TRUE, the program executes one block of code; a FALSE causes the execution of another (if any). The keyword else identifies the FALSE block. In Java, braces ({ }) are used to define the start and end of the block.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Author information

Authors and Affiliations

Authors

Copyright information

© 1998 William Buchanan

About this chapter

Cite this chapter

Buchanan, W. (1998). Java Selection. In: Mastering Java. Macmillan Master Series. Palgrave, London. https://doi.org/10.1007/978-1-349-14772-4_2

Download citation

  • DOI: https://doi.org/10.1007/978-1-349-14772-4_2

  • Publisher Name: Palgrave, London

  • Print ISBN: 978-0-333-73008-9

  • Online ISBN: 978-1-349-14772-4

  • eBook Packages: EngineeringEngineering (R0)

Publish with us

Policies and ethics