Skip to content

Instantly share code, notes, and snippets.

@cajar1988
Last active November 1, 2015 22:29
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save cajar1988/dabf4323dd3d3426b6aa to your computer and use it in GitHub Desktop.
final int price;
switch (vehicle) {
case CAR:
price = 17000;
break;
case BIKE:
price = 2000;
break;
case SKATEBOARD:
price = 500;
break;
default:
throw new IllegalStateException("Unsupported vehicle=" + vehicle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment