A data type determines what an object can do. In Julia, `typeof(42)` returns `Int64`, while `typeof('A')` returns `Char`. An array stores elements in order; a dictionary supports lookup by key. Type also matters to control flow: `true` can be used as an `if` condition, but `2.5` cannot. section 7.0
Types become useful when an application needs its own objects. A product catalog could represent each screw only by a number and use sets to find matching products. Alternatively, a `Screw` type can keep its product number, head type, drive style, and material together. Giving those attributes custom types helps catch an illegal category assigned to a field. section 13.5
struct Screw prodnum::Int headtype::HeadType drivestyle::DriveStyle material::Material end
The `Screw` definition shows how typed fields turn separate product attributes into one object. section 13.5
Types also shape everyday operations:
- Use a target type as a constructor for number conversion: `Float64(1//2)` produces `0.5`. Conversion can fail when the target cannot represent the value, as with `Int8(1000)` or `Int64(4.5)`. section 9.2
- Julia can call `convert` implicitly when assigning to a typed array element or composite field, or when a typed function returns. Parsing a number from a string is a different operation. section 9.2
- Types are objects themselves: they can be passed around, stored, and used by methods. section 9.2
Types have a performance role too. Julia fixes a composite type’s fields and their declared types: an instance cannot gain or lose fields, or store a value that does not match a field type. These restrictions help its JIT compiler generate optimized code. Parametric types matter here because they can help avoid the bookkeeping associated with boxed values. section 18.4 section 18.4

















