I just started to learn Dart and came across the below code
main(){
print(2.0 is int);
print(2.0 is double);
print(int is double);
}
It produces the below output
true
true
false
I am not sure why the above output is generated.
The above output suggests that all integers can be treated as doubles.
Am I missing something obvious here. Any pointers would help. Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…