看到昨天post的一道笔试题还比较受大家欢迎,
我准备把这个东西做成一个系列,
难度都不大,
算是对基础知识的一个回顾,
有兴趣的话大家就瞧两眼,
希望看明白之前不要用编译器调试笔试题系列之二


请指出下面代码的运行结果,并阐述原因

using System;
using System.Collections;
namespace param
{
 class Class1
 {
  [STAThread]
  static void Main(string[] args)
  {
   Hashtable ht = new Hashtable();
   for(int i = 0; i < 5;)
    ht.Add(new cusKey(i++),i);

   if(ht.ContainsKey(new cusKey(3)))
   {
    Console.WriteLine("find!");
   }
   else
   {
    Console.WriteLine("can't find!");
   }
   Console.Read();
  }

  public class cusKey
  {
   int keyNumber;
   public cusKey(int n) { keyNumber = n; }
  }

 }
}



更多笔试题

相关文章:

  • 2021-09-15
  • 2021-07-20
  • 2021-11-22
  • 2021-06-10
  • 2022-12-23
  • 2021-09-04
  • 2021-10-26
  • 2022-02-07
猜你喜欢
  • 2021-08-05
  • 2021-10-08
  • 2021-11-19
  • 2021-09-04
  • 2021-09-28
  • 2022-02-21
  • 2022-12-23
相关资源
相似解决方案