Variables, naming conventions, and comments

Data is stored in values such as 1, 3.14, and "Julia", and every other value has a type, for example, the type of 3.14 is Float64. Some other examples of elementary values and their data types are 42 of the Int64 type, true and false of the Bool type, and 'X' of the Char type.

Julia, unlike many modern programming languages, differentiates between single characters and strings. Strings can contain any number of characters, and are specified using double quotes—single quotes are only used for a character literal. Variables are the names that are bound to values by assignments, such as x = 42. They have the type of the value they contain (or reference); this type is given by the typeof function. For ...

Get Julia 1.0 Programming now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.