java tutorial - Java Decision-making operators - java programming - learn java - java basics - java for beginners



  • The decision-making structure consists of one or more conditions that are checked within the program together with the operator or operators that must be executed if the condition is determined to be true, and possibly other operators that will be executed if the condition is false.
  • The given below is a general view of the typical decision structure used in most programming languages:
 decision operator

Learn java - java tutorial - decision-making - java examples - java programs

The Java programming language offers the following types of decision-making operators:

Operator Description
if The if statement consists of a boolean expression followed by one or more statements.
if..else The if statement will be followed by an extra else clause, that is executed with a false boolean expression.
conditional (?:) You can use to replace the if ... else statements.
nested if You can use one if statement or an if ... else statement inside another or other if statements or if ... else.
switch The switch statement allows the variable to be checked for equality with respect to the list of values.

Related Searches to Java Decision-making operators