2011-08-16 23 views

回答

3

不怕。 Number是與您的Complex類無關的類型。所有您將收到一個:

1067: Implicit coercion of a value of type Number to an unrelated type Complex 

我能想到的唯一的事情會做這樣的事情:

asComplex(5); 

public function asComplex(num:Number):Complex 
{ 
    return new Complex(num); 
} 

,但不知道有很多點在。

相關問題