Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 1 of 1

Thread: Method of Sorting? by assiging numerical values to Strings

  1. #1
    Junior Member Mirage's Avatar
    Join Date
    Jun 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Method of Sorting? by assiging numerical values to Strings

    I remember there was some sort of method to assign a numerical value to values in an array, unfortunaetly I forgot how to do so, can anyone help?

    If I remember correctly the example in my old book was if there was a gear that had 3 settings stored in an array
    {LOW, MID, HIGH}
    Then they used some sort of method on this array and were able to use LOW, MID, HIGH as if they were numbers, also because of the order LOW was assigned the lowest numerical value, MID was assigned on higher than LOW but smaller than HIGH, etc

    They were then able to use LOW MID HIGH in a switch statement

    Thanks guys


    Never Mind I figured it out, the method is enumerated types
    Last edited by Mirage; June 16th, 2010 at 09:04 PM.


Similar Threads

  1. [SOLVED] sorting
    By kite98765 in forum Algorithms & Recursion
    Replies: 8
    Last Post: February 4th, 2010, 08:34 AM
  2. Sorting Algorithms
    By Dalisra in forum Java Programming Tutorials
    Replies: 1
    Last Post: November 10th, 2009, 09:24 PM
  3. Having trouble insert/sorting array values w/ binary searching.
    By bh-chobo in forum Collections and Generics
    Replies: 4
    Last Post: October 8th, 2009, 03:38 AM
  4. numerical conversion methods..
    By chronoz13 in forum Java SE APIs
    Replies: 12
    Last Post: September 27th, 2009, 05:29 AM
  5. [SOLVED] help with sorting...(comparator)
    By mdstrauss in forum Collections and Generics
    Replies: 2
    Last Post: July 26th, 2009, 07:25 AM