Dont understand Output. Could someone explain?

I know the output of this is 15.0 the question is WHY?

public class Cases{
public static void main (String[] arguments){
float x = 9;
float y = 5;

    int z = (int)(x/y);
    switch(z) {
        case 1:
        case 2:
    System.out.println("Value of x: " + x);


Switch cases fall through to the next one unless you break
Or at least that’s what I assume you’re missing, you haven’t said what you think should happen instead

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.