julia struct
# Structures (previously known in Julia as "Types")
#=
Defining a normal
Structure
=#
mutable struct MyOwnType
property1 # this is a dynamic typed object
property2::String # this is string type object (precisely declared)
end
#=
Defining a Structure
With Template
=#
mutable struct MyOwnType{T<:Number}
property1 # this is a dynamic typed object
property2::String # this is string type object (precisely declared)
property3::T # this is a template type T object
end
Are there any code examples left?
New code examples in category Julia
-
Julia 2022-02-26 07:00:03 how to push an element to array in julia
-
Julia 2022-02-09 11:00:04 how to output to stdout in julia
-
Julia 2022-01-30 21:01:18 julia declare variable
-
Julia 2021-11-21 20:25:14 julia better than python
-
Julia 2021-11-20 02:52:19 julia float to int
-
Julia 2021-11-13 22:50:16 ncol in julia
-
Julia 2021-10-20 09:59:05 check if array contains a value julia
-
Julia 2021-10-16 20:10:07 how to accept input from stdin in julia
-
Julia 2021-10-09 12:46:09 identify current hostname in julia