You should implement

lumlumq (lumlum)
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

2001-4-11 -04:00

回到话题: 有奖征答活动!!!! --我家领导想请教一个CORE JAVA问题...

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT杂谈