The Little Lemon Cafeteria accepts three forms of payment, cash, card, and check. For each transaction you have to specify the payment method, but how can you represent in it code? A straightforward way is to use a string. Here I use a string, and here I can compare different possible string values. But when using this technique, there's no guarantee that the string is correct, so the method is prone to mistakes. This transaction is for a cash payment. If I have a typo, my code will still compile, but the result will be incorrect. How can I improve on that? A better way to represent possible values in Kotlin is using enum classes. Enum is a special class that represents a set of possible values. It's defined first by the enum modifier, followed by the class keyword and then the class name. In this case, it can be payment method. In the body of this class, I specify the possible values which are cash, card, and check. Instead of using a string, I'm using an enum class named payment method. You also need to use the new class name to specify a payment method value. Notice that I start typing payment method and it auto-completes the value options, cash, card, and check, so I just need to select one. Those are all the possible values that can be passed to this function as a payment method argument, it can only be cash, card, or check. Nothing else will be accepted, so I choose check. Here, depending on the chosen payment method, I call a different function. But when a string is used, I also need to account for a situation where an unknown payment method is provided. This is because a string can't guarantee that the past value is cash, card, or check. On the other hand, enum class does give such a guarantee. In one expression, it's enough to use all three possible values and handle them in their own ways. An extra else branch isn't needed because Kotlin knows that all the possible payment methods are covered and that there's nothing else that can be passed. Of course, if a new payment method is added like PayPal, the when expression needs to be extended to cover another payment method. But even without it, I know that at least three other methods are covered. Let me share some other advantages of enum classes. First, enum classes can be easily transformed into a string. If I print PaymentMethod.cash as a string, it will display the cash value, which is a nice support when I do programming and I learn about how the program works based on these prints. Also, each payment method has an ordinal that tells you what its position is in the enum declaration. An ordinal is a position and the count starts at zero, which is typical for programming. The ordinal of cash is zero because it's the first position, the ordinal of card is one, and the ordinal of check is two. Another useful feature of enum classes is that you can easily iterate over payment methods. I can use a for loop to iterate over PaymentMethod.values. This is a function that returns an array of payment methods. You'll learn more about such collections later. For now, all you need to know is that you can use it to iterate over all payment methods. You can use it too, for instance, print the method name. If you have a string with a payment method, for example, string one is cash, then you can transform it into a payment method using PaymentMethod.valueOf(string1). This function gives you the cash payment method. You can print it and it will print cash. You can also transform it back into a string using payment method dot name. Note that this is a string and this is a payment method. You can easily switch between enum class value and string using the value of a named functions. As demonstrated in this video, enum classes offer a lot of positives, and it is good to use them to represent a set of possible values. You should now be familiar with what enum class are, their benefits, and how they are used in Kotlin.