Dart编程实例 - 位运算符

本文为大家分享 Dart编程实例 - 位运算符 的具体示例代码,提供大家参考,具体内容如下:

void main() {
   var a = 2;  // Bit presentation 10
   var b = 3;  // Bit presentation 11

   var result = (a & b);
   print("(a & b) => ${result}");    
   result = (a | b);
   print("(a | b) => ${result}");
   result = (a ^ b);
   print("(a ^ b) => ${result}");

   result = (~b);
   print("(~b) => ${result}");  

   result = (a < b);
   print("(a < b) => ${result}");

   result = (a > b);
   print("(a > b) => ${result}");
}

本文为大家分享 Dart编程实例 - 更新列表 的具体示例代码,提供大家参考,具体内容如下:void main() { List l = [1, 2, 3,4,5,6,7,8,9]; print('The v ...