下面3个命题,哪个(些)是永假命题(永远返回false):

   1:          bool QuestionAboutDouble(double x, double y)
   2:          {
   3:              return x.Equals(y) && x != y;
   4:          }
   5:   
   6:          bool QuestionAboutType(int[] x)
   7:          {
   8:              if (x == null)
   9:                  return false;
  10:              return x.GetType() != typeof(int[]);
  11:          }
  12:   
  13:          bool QuestionAboutInt(int x)
  14:          {
  15:              for (int i = 0; i < 100; i++)
  16:                  x = x + x;
  17:              return x < 0;
  18:          }

 

    下面一道题的返回值是多少:

   1:          int QuestionAboutClosure()
   2:          {
   3:              int x = 0;
   4:              Func<int>[] funcs = new Func<int>[10];
   5:              for (int i = 0; i < 10; i++)
   6:                  funcs[i] = () => x += i;
   7:              (from f in funcs select f()).Count();
   8:              return x;
   9:          }
posted on 2010-06-21 13:07  Zhenway  阅读(522)  评论(12编辑  收藏  举报