Answers for "switch statement greater than"

3

js switch case greater than

switch (true) {
  case (0 <= val &&  val < 1000): /* do something */ break;
  case (1000 <= val &&  val < 2000): /* do something */ break;
  ...
  case (29000 <= val &&  val < 30000): /* do something */ break;
}
Posted by: Guest on September-02-2020
0

switch case less than java

switch (lessThan)
	{
    
    //Less than cannot techinically be added so we use the numbers less than those numeberss
		case 1:
		case 2:
		case 3:
		System.out.println("This name has 3 or less characters");
		break;

		case 4:
		System.out.println("This name has 4 characters");
		break;
    
	}
Posted by: Guest on November-03-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language