×

Loading...

Topic

This topic has been archived. It cannot be replied.
  • 工作学习 / IT杂谈 / 有奖征答活动!!!! --我家领导想请教一个CORE JAVA问题...
    想针对一个既定的Container Class产生其相关的Enumeration Class,
    后者的constructor应该怎样写?

    急盼高手赐教.

    (有关评奖细则见跟贴!)
    • 你先把奖励办法说出来.
    • 破人!先说好奖什么再说!
    • 领导说了:奖品为找到工作时特搓一顿,最佳答案者做桌长.
      • 不要兜圈子。桌长有什么好处先?
        • 桌长可以自选座位,譬如......把自己安排在俩个漂亮的GG或MM中间.
          • 你的意思是坐在你和你领导之间?那太辛苦了,太危险了——要承担双重危险的说啊!
    • You should implement
      your own Enumeration class as an inner class(non-static).
      This inner class implements the interface Enumeration.
      The beauty of the inner class lies in that this class has full access
      to any private data members. Each time an object of the container
      class is instantiated, the compiler will implicitly create an object of
      this inner class, which is attached to the container class instance.
      So in your Enumeration class constructor, you have full access to the
      members of your container class instance(notice here that it's guranteed the container class object has been created).
      So what you should do is just initilize the pointer in your inner class pointing to the first element in your container class object.
      class has been created
      • @@ lumlum原来是高手?!
        • xixi... bonzer!!(mimicing an aussie).. xixi.. you will find out a lot more.. lumlum ^_^
          • are you from Austrailia? I'm from Sydney
            • Me? no, I am in Canada right now....
        • 怎么没人问和Microsoft产品相关的问题?
    • There are a lot of examples in any Java book,
    • 感谢各位大虾。 领导在你们的指导下, 成功攻克第197个堡垒。 抱拳于胸前,动俩动, 说:敬礼!
      • 该说承让!