Can we pass two parameters in switch case in Java?

Anyway. Second, the only way to use switch with multiple variables is to combine them into one primitive (string, number, etc) value: var stateA = “foo”; var stateB = “bar”; switch (stateA + “-” + stateB) { case “foo-bar”: … … }

Sizin İçin Seçtik  Can we use string in switch case in JavaScript?

Leave a Reply

Your email address will not be published. Required fields are marked *