Dart语言相等和关系运算符

void main() { 
   var num1 = 5; 
   var num2 = 9; 
   var res = num1>num2; 
   print('num1 greater than num2 ::  ' +res.toString()); 
   res = num1<num2; 
   print('num1 lesser than  num2 ::  ' +res.toString()); 
   res = num1 >= num2; 
   print('num1 greater than or equal to num2 ::  ' +res.toString()); 
   res = num1 <= num2; 
   print('num1 lesser than or equal to num2  ::  ' +res.toString()); 
   res = num1 != num2; 
   print('num1 not equal to num2 ::  ' +res.toString()); 
   res = num1 == num2; 
   print('num1 equal to num2 ::  ' +res.toString()); 
}

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/266107.html

(0)
上一篇 2022年6月7日
下一篇 2022年6月7日

相关推荐

发表回复

登录后才能评论