Instantly share code, notes, and snippets.

@cajar1988 /match2.java Secret
Last active Nov 1, 2015

Embed
What would you like to do?
final int price;
if (vehicle == Vehicle.CAR) {
price = 17000;
} else if (vehicle == Vehicle.BIKE) {
price = 2000;
} else if (vehicle == Vehicle.SKATEBOARD) {
price = 500;
} else {
throw new IllegalStateException("Unsupported vehicle=" + vehicle);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment