Enum CarType

    • Enum Constant Detail

      • SMALL

        public static final CarType SMALL
        Low risk for theft, high risk for injuries inside.
      • MEDIUM

        public static final CarType MEDIUM
        Normal risk
      • LARGE

        public static final CarType LARGE
        High risk for theft, low risk for injuries inside, high risk for injuries outside.
      • SPORT

        public static final CarType SPORT
        High risk for everything
      • MUSCLE

        public static final CarType MUSCLE
        High risk for everything
      • LUXURY

        public static final CarType LUXURY
        High risk for repair costs.
    • Method Detail

      • values

        public static CarType[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (CarType c : CarType.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CarType valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null