Question: Given this code fragment: 1double x = -0.5; 2 3while (x * x 4{ 5switch ((int) x) 6{ 7case 4, 3, 2 -> System.out.println(x=
Given this code fragment:
1double x = -0.5;
2
3while (x * x
4{
5switch ((int) x)
6{
7case 4, 3, 2 -> System.out.println("x= " + x);
8default ->
9System.out.println("something else, x= " + x);
10} // end switch
11x += 2;
12} // end while
Trace the code using either the short form or the long form. To help you get started, here's the trace setup. The third column is for switch's controlling expression. For the short form, you won't need the line# column.

\f
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
