From e675e9733c66d894a7c2557db5240af15f56fcd3 Mon Sep 17 00:00:00 2001 From: Jan Pearce Date: Tue, 26 Aug 2025 10:36:22 -0400 Subject: [PATCH] hot-fix --- source/ch4_conditionals.ptx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/ch4_conditionals.ptx b/source/ch4_conditionals.ptx index 382e671..0b32d00 100644 --- a/source/ch4_conditionals.ptx +++ b/source/ch4_conditionals.ptx @@ -163,12 +163,12 @@ public class ElseIf {

Java also supports a switch statement that acts something like the elif or Python match statement under certain conditions. To write the grade program using a switch statement we would use the following: -

The match - case statement was introduced in Python 3.10, so doesn't run in earlier version of Python. Here is an example using Python's match - case structure. -

+

Match Case Example @@ -190,7 +190,6 @@ Java also supports a switch statement that acts something like the eli print(grading(tempgrade)) -

switch The switch statement in Java provides an alternative to chaining multiple if-else conditions, when comparing a single variable against several constant values. It supports a variety of data types, including primitive types (byte, short, char, int), their wrapper classes, enumerations, and String (introduced in Java 7). Each case within a switch must be defined using a constant expression, and duplicate case values are not permitted. By default, control flow "falls through" from one case to the next unless a break, return, or throw statement is used to terminate execution.