Home > Java > Switch Statement > Definitions
Definitions

Top 10 Switch Statement Definitions

1

The switch is sometimes classified as a selection statement. The switch statement selects from among pieces of code based on the value of an integral expression.

Author:
Bruce Eckel
Source:
Type:
Book

Rating: 0.0/5 (0 votes cast)

Favorite
2

The switch statement is Java's multiway branch statement. It provides an easy way to dispatch execution to different parts of your code based on the value of an expression. As such, it often provides a better alternative than a large series of if-else-if statements.

Author:
Patrick Naughton, Herbert Schildt
Source:
Type:
Book

Rating: 0.0/5 (0 votes cast)

Favorite
3

Unlike if-then and if-then-else, the switch statement allows for any number of possible execution paths. A switch works with the byte, short, char, and int primitive data types.

Author:
java.sun.com
Source:
Type:
Website

Rating: 0.0/5 (0 votes cast)

Favorite
4

In computer programming, a switch statement is a type of selection control statement that exists in most modern imperative programming languages (e.g., Pascal, C, C++, C#, and Java). Its purpose is to allow the value of a variable or expression to control the flow of program execution via a multiway branch (or "goto", one of several labels). The main reasons for using a switch include improving clarity, by reducing otherwise repetitive coding, and (if the heuristics permit), offering the potential of faster execution through compiler optimization.

Author:
Wikipedia
Source:
Type:
Website

Rating: 0.0/5 (0 votes cast)

Favorite
5

The switch statement in Java provides a convenient method for branching a program based on a number of conditionals.

Author:
Rex
Source:
Type:
Website

Rating: 0.0/5 (0 votes cast)

Favorite
6

Java has a shorthand for multiple if statements, the switch-case statement.

Author:
ibiblio.org
Source:
Type:
Website

Rating: 0.0/5 (0 votes cast)

Favorite