Multiple inheritance allows to specify that one  class is a subclass of several other classes.

Some languages allow multiple inheritance for arbitrary classes,   others restrict it to interfaces,   some don't allow it at all.



Task

Write two classes (or interfaces) Camera and MobilePhone,   then write a class CameraPhone which is both a Camera and a MobilePhone.

There is no need to implement any functions for those classes.




 
abstract type Phone end
 
struct DeskPhone <: Phone
    book::Dict{String,String}
end
 
abstract type Camera end
 
struct kodak
    roll::Vector{Array{Int32,2}}
end
 
struct CellPhone <: Phone
    book::Dict{String,String}    
    roll::Vector{AbstractVector}    
end
 
function dialnumber(phone::CellPhone)
    println("beep beep")
end
 
function dialnumber(phone::Phone)
    println("tat tat tat tat")
end
 
function snap(camera, img)
    println("click")
    push!(camera.roll, img)
end
 
dphone = DeskPhone(Dict(["information" => "411"]))
cphone = CellPhone(Dict(["emergency" => "911"]), [[]])
 
dialnumber(dphone)
dialnumber(cphone)
 