Greetings! Just like if, when also an expression. It has 2 forms. With a value - behave as a switch operator. Without a value - behave as if-else-if chain. when as a switch Java private void dayOfWeek(int dayOfWeek) { switch (dayOfWeek) { case 1: System.out.println("Sunday"); break; case 2: System.out.println("Monday"); break; case 3: System.out.println("Tuesday"); break; case 4: System.out.println("Wednesday"); break; case 5: System.out.println("Thursday"); break; case 6: System.out.println("Friday"); break; case 7: System.out.println("Saturday"); break; default: System.out.println("Invalid day"); } } Kotlin private fun dayOfWeek(dayOfWeek: I...
May all beings be happy, be well, be peaceful, and be free