Hi Srikanth

Try this way  ----

public class EnumType implements Serializable {

    public static final EnumTypeTYPE_ONE;
    public static final EnumType TYPE_TWO;

    public static final EnumType [] enumTypes = new EnumType [2];

    static {

     TYPE_ONE = new EnumType ("one");    // Or,  whatever constructor u
require
     TYPE_TWO = new EnumType ("two");
      enumTypes [0] =TYPE_ONE;
      enumTypes [1] = TYPE_TWO ;

     }
    private EnumType (String s){
     this.s = s;
    }
}

Then write accessors in this class that depend on your requirements.
Hope this answers ur question

G.Vijay
Unique Solutions (India) Private Limited
4th Floor, Sufi Chambers,
Road No.1, Banjarahills
Hyderabad- 500 034
AP , INDIA

Phone : + 91- 40 - 666 8020 Ext 434
Fax      : + 91- 40 - 337 6175
Url       :  www.uniquecomputing.com



                    Srikant Chonnad
                    <srikant.chonnad@SIR        To:     [EMAIL PROTECTED]
                    ITECH.COM>                  cc:
                    Sent by: A mailing          Subject:     Implement enum in Java
                    list for Enterprise
                    JavaBeans
                    development
                    <[EMAIL PROTECTED]
                    UN.COM>


                    02/14/2002 06:40 PM
                    Please respond to
                    srikant.chonnad






Hi,
     I want to implement 'enum' (as in C++) in Java. Please help.

Regards,
Srikant.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to