Results 1 to 3 of 3
  1. #1
    Zarah is offline Senior Member
    Join Date
    Mar 2014
    Posts
    286
    Rep Power
    6

    Default How are Java Enum types more powerful than those in other languages

    Java programming language enum types are much more powerful than their counterparts in other languages. - source

    2. How are Java Enum types more powerful than their counterparts in other languages?
    Last edited by Zarah; 04-23-2016 at 02:29 PM.

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: How are Java Enum types more powerful than those in other languages

    Well, the source you cited explains it pretty well. And since I am not that familiar with enums in other languages I couldn't offer much anyway.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,423
    Blog Entries
    7
    Rep Power
    27

    Default Re: How are Java Enum types more powerful than those in other languages

    In quite a lot of other languages, enums are just ints without the arithmetic; the compiler takes care of that; in Java, enums are real classes with all the stuff that comes with them; the Java compiler doesn't allow you to create an enum instance yourself, so they survive de/serialization too ...

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

Similar Threads

  1. Why are my enum types not being recognized by my methods?
    By Propinquity in forum New To Java
    Replies: 13
    Last Post: 03-17-2014, 05:10 PM
  2. generic and different enum types
    By vojtab in forum New To Java
    Replies: 0
    Last Post: 11-08-2010, 05:11 PM
  3. Replies: 1
    Last Post: 10-13-2009, 07:31 AM
  4. P~ 0.9 : Java-friendly scripting with powerful regex
    By p7eregex in forum Java Software
    Replies: 0
    Last Post: 12-17-2007, 08:10 PM

Posting Permissions

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