Nếu bạn xem xét rằng có khoảng 262 phân số khác nhau hai lần giữa o và 1, khả năng vươn tới bất kỳ một giá trị thực nghiệm có thể vượt quá tuổi thọ của một máy tính, hoặc thậm chí một trong thí nghiệm. Nó chỉ ra rằng 0,0 là bao gồm trong đầu ra của (). Hoặc, trong ngôn ngữ toán học, nó là 0,1). | Simpo PDF Merge and Split Unregistered Version - http import . public enum Course APPETIZER MAINCOURsE DESSERT COFFEE private Food values private Course Class extends Food kind values public Food randomSelection return values Each of the above enums takes the corresponding Class object as a constructor argument from which it can extract and store all the enum instances using getEnumConstants . These instances are later used in randomSelection so now we can create a randomly generated meal by selecting one Food item from each Course enumerated menu package public class Meal public static void main String args for int i 0 i 5 i for Course course Food food food --- . . Output Spring_rOlls VINDALOO FRUIT DECAF_COFFEE SOUP VINDALOO FRUIT TEA SALAD BURRITO FRUIT TEA SALAD BURRITO CREME_CARAMEL LATTE SOUP BURRITO TIRAMISU ESPRESSO Enumerated Types 735 Simpo PDF Merge and Split Unregistered Version - http In this case the value of creating an enum of enums is to iterate through each Course. Later in the example you ll see another approach to categorization which is dictated by different constraints. Another more compact approach to the problem of categorization is to nest enums within enums like this enumerated More succinct subcategorization of enums. import . enum SecurityCategory STOCK BOND Security values SecurityCategory Class extends Security kind values interface Security enum Stock implements Security SHORT LONG MARGIN enum Bond implements Security MUNICIPAL JUNK public Security randomSelection return values public static void main String args for int i 0 i 10 i .