Ruby b = “test” variable: No Typing value : String 第⼀一次赋值: 只记录「值」的类型,并不做类型检查 only record, haven’t type-checking, when varibale assigement 13年8月26⽇日星期⼀一
Ruby b = “test” variable: No Typing value : String 第⼀一次赋值: 只记录「值」的类型,并不做类型检查 only record, haven’t type-checking, when varibale assigement 13年8月26⽇日星期⼀一
Ruby b = “test” variable: No Typing value : String variable b => String typing 第⼀一次赋值: 只记录「值」的类型,并不做类型检查 only record, haven’t type-checking, when varibale assigement 13年8月26⽇日星期⼀一
Ruby interface Animal def swimming;end end Pseudocode(伪代码) in Static Language, like Java class Duck implement Animal def swimming puts “duck swimming” end end 13年8月26⽇日星期⼀一
Ruby interface Animal def swimming;end end Pseudocode(伪代码) in Static Language, like Java class Duck implement Animal def swimming puts “duck swimming” end end class Goose implement Animal def swimming puts “goose swimming” end end 13年8月26⽇日星期⼀一
Ruby interface Animal def swimming;end end Pseudocode(伪代码) in Static Language, like Java class Duck implement Animal def swimming puts “duck swimming” end end class Goose implement Animal def swimming puts “goose swimming” end end Animal animal = Duck.new Animal animal = Goose.new animal.swimming 13年8月26⽇日星期⼀一
Ruby in Ruby class Duck def swimming puts “duck swimming” end end class Goose def swimming puts “goose swimming” end end duck = Duck.new goose = Goose.new [duck, goose].each do |animal| animal.swimming end 13年8月26⽇日星期⼀一