Julia's type hierarchy
All types in Julia live within a type hierarchy. This hierarchy is rooted at the top by the Any type. All Julia types, without exception, live within this hierarchy. In particular, unlike languages such as Java, there is no distinction between so-called primitive types and reference types. While there may be differences as to how the numbers are represented internally compared to user-defined types, as far as the type system is concerned, they form a unified hierarchy.
When a type declaration is omitted for a variable or parameter (as in many of the examples in the previous chapter), it can contain values of any type. This is denoted by the special Any type. The Any type can therefore be seen as being at the top of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access