Results 1 to 4 of 4
  1. #1
    Join Date
    Sep 2010
    Posts
    22
    Rep Power
    0

    Default Setting values from One Enum type to another enum type.

    Hi,
    Can you please let me know how to set value of one class/interface enum value to another class/interface enum value.

    Here is the requirement:

    Enum A - 1, 2,3, 4,

    Enum B- 11,22,33,44


    Getting Value from Enum A and it has to be assigned to Enum B.


    Is there any casting required.

    I am seeing error as:


    The method setAccountNum(B.Enum) in the type MemberAccount is not
    applicable for the arguments (A.Enum)


    How to do this casting/assignement??

    Thanks,
    Raj.

  2. #2
    Join Date
    Sep 2010
    Posts
    22
    Rep Power
    0

    Default

    B.setAccount(AccountSubTypeEnum.Enum.forString(A.g etAcctType().toString()));

    Still best way's are expected...

  3. #3
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,039
    Rep Power
    20

    Default

    ?

    You're going to have to give us a proper example that shows your problem, because I didn't understand any of that.

  4. #4
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

Similar Threads

  1. enum
    By billq in forum New To Java
    Replies: 3
    Last Post: 01-03-2010, 08:38 PM
  2. using instanceof to get Object type and parent type?
    By xcallmejudasx in forum New To Java
    Replies: 2
    Last Post: 11-06-2008, 06:24 PM
  3. [SOLVED] Cast string type to int type
    By GilaMonster in forum New To Java
    Replies: 9
    Last Post: 09-17-2008, 10:43 AM
  4. passing an enum type as a parameter ??!
    By SCS17 in forum New To Java
    Replies: 11
    Last Post: 07-13-2008, 01:44 PM
  5. Uisng primitive type values as keys for Hashtable
    By ravian in forum New To Java
    Replies: 3
    Last Post: 11-21-2007, 10:13 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •