Help: a question about the Enum......

Hi,
Now I defined a Enum like below:
public enum Seasons {  
winter, spring, summer, fall  
}  and here below is testing code
System.out.println(Seasons.winter);  the console will print 0.
Now I have a variable, its value is 2, so it should be mapping to Seasons.summer
int idx = 2;but how to write the code to get the Seasons.summer?

you can't (easily)
and you shouldn't
the whole point is that enumerations are abstract; you shouldn't be able to use them like integers and do arithmetic on them
what are you doing that will require this?
if you really wanted to, the Class class has a method called getEnumConstants() which returns an array of the enum objects in order of their ordinal value; so you could do something like
Seasons.class.getEnumConstants()[2]Edited by: spoon_ on Dec 18, 2007 2:11 AM

Similar Messages

  • Question about the ability of Genius Bar to help with outside software...

    Hi I wasn't sure where to put this, but here's my question. I'm having a problem with the Sims 2 on my Macbook and I was wondering if I go to the Genius Bar will they be able to help me or are they strictly hands off when it's not a direct Apple product?
    Also, I bought an external hard drive in the Apple Store but it's not an Apple branded product. If I'm having a problem with that, can I go to the Apple Store?

    If it's a question about the installation, system requirements or compatibility with your MacBook, the Mac Genius can probably help. If you're having some kind of issue while using the Sims 2, you'll probably have to contact .
    The same is true with the hard drive. If you need some help getting it connected or even formatted, they can probably help. However, if it's not powering up or you're losing files or some kind of operational issue with the hard drive after it's connected, they'll probably refer you to the manufacturer.
    Usually Apple can't support other vendors' products. Someone here may be able to give you some more advice, since none of us work for Apple. There may be someone here who's already had the same issue with the Sims.
    -Doug

  • I want to question about the official service at the service center of Sony.

    I want to question about the official service at the service center of Sony.
    long since I like the models and items sony. from start playstation, cameras, camcorders up, I've ever had. and a new camera that I bought two years ie compact cameras Sony Cybershot DSC H200. as of a month ago, a camera was having problems in lenses that would not close. and setting the automatic mode to move by itself. I came to the Sony Service Center in Makassar, precisely on Jl. Shop Pengayomann A5 / 05 (0411) 442340.
    operator initially said only two weeks to work on my camera. but this week has been more dau even want to go in a month tomorrow, dated July 9, no news from the service center. and I kept the call to the office service. as well as assorted reasons. there are no spare parts or technical constraints, and the last one I call to his office, he said the factory spare part is damaged. imported directly from Singapore. I think, ko new spare part it can be damaged before using that? how the quality of this Sony spare part? ugly? not good? why?
    I was disappointed with this situation, where soon it will Eid, want to return home as well to Java. but the camera has not been settled workmanship?
    nah, roughly what is the solution of the Sony plagued with this problem? please help, because he did not know to whom to complain. operator had just said: it's up to the father alone.
    once again I asked for his help. solution. if you can before Eid arrived.
    Thank you,
    AD. Rusmianto

    Hi awwee107, 
    Welcome to the Sony Community! 
    We have forwarded your query to the relevant team for their further assistance and someone from local CC will contact you.
    Thanks!
     

  • Question about the notification center (Mails and Reminders)

    Hello together,
    I just started using Mountain Lion and now I have some few questions about the notification center.
    1. Is it possible to show all reminds in the notification center? I have a lot of reminds without an date / time and they don't appear in the notification center.
    2. Is it possible to show the last five Mails in the notification center? I'm just seeing new incoming mails, but I would prefer it, if I could see the last five mails
         (no matter if readed or unreaded).
    Thank you very much for you help.
    Ratte1988       
    Hallo zusammen,
    ich habe gerade damit begonnen Mountain Lion zu verweden und habe einige Fragen zur Mitteilungszentrale.
    1. Ist es möglich alle Erinnerungen in der Zentrale anzuzeigen? Ich habe viele Erinnerungen, die ohne Datum / Uhrzeit sind und in der Mitteilungszentrale
         daher nicht auftauchen.
    2. Ist es möglich, sich die letzten fünf Mails in der Zentrale anzeigen zu lassen? Ich sehe nur neue ungelesene Mails, würde es aber vorziehen die letzten
         fünf Mails sehen zu können (egal ob gelesen oder ungelesen.)
    Danke für eure Hilfe.
    Ratte1988

    Only reminders with dates appear in the notification center - undated ones don't. Once an email has been read, it is removed from the notification center. Apple has a feedback center where you can offer suggestions.

  • Some question about the renegotiation function in SRM Contract (GOA)

    Hi All Expert,
    We are on SRM 5/4.6,  there is a question about the renegotiation function in SRM GOA.
    Can we renegotiate the price for some parts in the GOA items with this function ( e.g. Only renegotiate one item in the contract) ?
    Will the item price updated automatically after the renegotiation?
    Many thanks in advance!!!
        Wendrin

    Hi Sanjeev,
    Many thanks for your help.
    One more question, if I add a new item when we renegotiation, will it be transfered to contract and create a new item after that?
    Thanks and best regards
    Wendrin

  • Dear Customer Service Team,  I bought a twelve-month Dreamweaver CC program with monthly payment that I have paid via bank transfer and there would be a question about the activation. How could I get the license key with which I can activate my account? I

    Dear Customer Service Team,
    I bought a twelve-month Dreamweaver CC program with monthly payment that I have paid via bank transfer and there would be a question about the activation. How could I get the license key with which I can activate my account? I can not find it and now I only have access to the trial version.
    Thank you for your help in advance.
    Kind Regards,
    G. Zsolt

    There is no serial number require for Creative Cloud products, you may activate the products using your email address and password which is associated with Adobe. If your Dreamweaver asking for serial number, then make sure you are signing in with correct email address.
    You may also refer below link
    Sign in, activation, or connection errors | CS5.5 and later

  • This is a two part question about the creative 16gb Zen?

    8This is a two part question about the creative 6gb Zen? First of all, my battery life dropped very suddenly. One charge I was getting the full 30 hour battery life and the next it dropped to under ten. I tried using their tips on how to extend the battery life and I am still getting less than 0 hours of battery life. Why would it dropped more than half the amount between charges? I tried recharging it after it ran out and still the same thing. Any help?
    Second, (I am adding this question because it might relate to the first in some way) my mp3 player has been behaving strangely lately. For example, some artists sometimes have letters removed or all but the first end up being removed. But, if you reset the player, the artists go back to the full name. Also, my player has been taking a little longer than usual to turn on. It takes about 30 seconds to turn on instead of the 5-0 that I'm used to. Does anyone know why this might be happening?
    My Zen is only 4 months old, and I would be very upset it it's breaking already. Please, if you have any suggestions on how I can fix what's happening, post them. (Even if they?probably won't work, they're worth a try.)

    < This is an unusual one; never heard of it before. All I can suggest is cleaning up and perhaps reflashing the firmware. If it still is doing this, then get the thing exchanged pronto.
    My guess is that the problems are indeed closely related.

  • Question about the order to creating Account, Contact, Contact Role

    Hi, my friends,
    I have some questions about the order of creating Account, Contact, Contact Role, etc in Web Service 1.0. I could create them in the following case:
    1. Insert Contact object and get contactId (now new contact exists in CRMOD)
    2. Insert Account object with Contact Role child associated with contactId
    My questions are:
    1. Do we have the following order? Insert new Account with new Contact child and Contact Role child (Contact is new and does not exist in CRMOD).
    2. Looks like system need accountId, contactId, etc to make the objects relationship. Is there other field having the same function?
    Thanks
    Ray

    Hi Ray,
    In response to your questions:
    1. Do we have the following order? Insert new Account with new Contact child and Contact Role child (Contact is new and does not exist in CRMOD).No. Both the Account and Contact must already exist. The Role value is an attribute on the Account Contact relationship, this relationship must exist in order to assign a role value to it. This is consistent with the behaviour of the UI, when you press the New button on the Contact child applet, you are taken to the Contact New page where you can create a Contact record. Once you save, the relationship is created but you cannot assign a role value unless you click the Edit Roles link next to the new Contact.
    2. Looks like system need accountId, contactId, etc to make the objects relationship. Is there other field having the same function?Correct, the system needs to know which Account/Contact pair is being assigned a role value. To do this the Account and Contact values must be uniquely identified using the Id values for each.
    I hope this helps.
    Thanks,
    Sean
    Edited by: Sean Duffy on Jan 25, 2010 10:11 AM

  • Question about the function module (RFC_READ_TABLE)

    Dear everyone
    Could I ask you a question about the function module (RFC_READ_TABLE)?
    I was asked if it's possible to create a report which compares the data between different SAP systems (both production systems).
    Now, the easiest way would be to use the function module (RFC_READ_TABLE) within a SAP infoset query (SQ01 type query).
    But I heard the rumor that using the function module (RFC_READ_TABLE) is not advisable due to the security reason.
    However, I am not exactly sure what sort of security problems this function module can possibly have...
    Would you help me on this?
    I also would like to know if using "remote enabled module" type function module can always overcome this possible security issue.
    Or, are there any points that I need to be careful about even when I use "remote enabled module" function module?
    Thank you very much in advance.
    Takashi

    Dear Fred-san
    Thank you very much for your support on this.
    But, may I double check about what you mentioned above?
    So, what you were mentioning was that if some user executes the query with
    the function module (RFC_READ_TABLE), under the following conditions, he can access to
    the HR data even when he does not have the authorizations for HR transactions?
    <Conditions>
    1. the user has the authorization for HR database tables themselves
    2. RFC_READ_TABLE is called to retrieve the data from HR database
    <example>
    Data: LF_HR_TABLE like  DD02L-TABNAME value 'PA0000'.
    CALL FUNCTION 'RFC_READ_TABLE'
       EXPORTING
        query_table                = LF_HR_TABLE
      TABLES
       OPTIONS                    =
       fields                     =
       data                       =    .
    But then, as long as we call this function module for a non-critical tables such as
    VBAP (sales order) or EKKO (purchase order) within our query, it wouldn't seem to be
    so security risk to use RFC_READ_TABLE...
    Besides, each query (infoset query) has got the concept of user groups, which limits
    the access to the queries within the user group.
    ※If someone does not belong to the user group, he cannot execute the queries within that
       user group, etc
    So, my feeling is that even infoset queries does have authorization concept...
    Would you give me your thought on this?
    I also thank you for your information for SCU0.
    That is an interesting transaction
    Kind regards,
    Takashi

  • Muvo V200, question about the play m

    Hello,I have a question about the play mode on my V200. I want to play the songs in a specific order (like in a playlist) but I don't find the way to do this. Can you help me please ?
    Thanks
    (sorry if I don't speak english very well, but I'm french )

    Hi!
    To get the tracks to play in a specific order, put numbers at the beginning of each file name. E.g.: file 'examplesong.mp3' would become '0_ examplesong.mp3' Don't spend years doing that manually though; the computer will do it for you! Click on 'my computer', then click on 'Muvo V200 media explorer'.. This shows the contents of your player. Choose the folder that you want to reorder the songs in...
    ( it's best to put the songs in folders, like you would in a floppy disk, as the muvo can only hold a certain amount in the root directory, and folders are great for organisation - eg: you can put one CD in each folder, and then the player will play all of the tracks in that folder before moving on to the next one )
    ...and click on it to display the songs. In the pictures along the top of the window, 4th from the right is an icon with a downward facing arrow and an A above a Z. Click on this, it's called 'custom sort'. You can then use the arrows at the bottom to change the order of your tracks to how you want them. Click OK, and they'll all be numbered (and so will play) in that order.
    Hope that helps!
    x

  • Hi All, I have question about the iMac operating system. I have the last updated. The problem when I manage the place of the folder windows they are all mixing up. I mean they not on the place where I left them. how to set they stay on the same place. Tks

    Hi All, I have question about the iMac operating system. I have the last updated. The problem when I manage the place of the folder windows they are all mixing up. I mean they not on the place where I left them. how to set they stay on the same place? I know there are different possibilities to set.
    I tried but it not helped for me. What I can do? How and where can set this they stay on their place?
    Thanks.
    laci

    Option 1
    Back Up and try rebuild the library: hold down the command and option (or alt) keys while launching iPhoto. Use the resulting dialogue to rebuild. Choose to Repair Database. If that doesn't help, then try again, this time using Rebuild Database.
    If that fails:
    Option 2
    Download iPhoto Library Manager and use its rebuild function. (In Library Manager it's the FIle -> Rebuild command)
    This will create an entirely new library. It will then copy (or try to) your photos and all the associated metadata and versions to this new Library, and arrange it as close as it can to what you had in the damaged Library. It does this based on information it finds in the iPhoto sharing mechanism - but that means that things not shared won't be there, so no slideshows, books or calendars, for instance - but it should get all your events, albums and keywords, faces and places back.
    Because this process creates an entirely new library and leaves your old one untouched, it is non-destructive, and if you're not happy with the results you can simply return to your old one. 
    Regards
    TD 

  • I'm looking to buy a new Macbook Pro, and have questions about the Applecare extended warranty?

    I'm looking to buy a new Macbook Pro, and have questions about the Applecare extended warranty? I want to know if the 3 year extended warranty covers what damage. Like water damage, accidental damage, lost or stolen macbook, manufactory defects, or any other kind of damage, maybe be even cosmetic damage. Can anyone help me?

    If you are talking about features of the MBP itself, as long as you are not looking at  the Retina models, then the memory you can upgrade yourself for a lot less than Apple charges, and that does not affect the warranty as Apple considers memory a user permitted upgrade.  Great sources are Crucial and OWC, both are Mac specialists and have on-line videos on how to do the install.
    If the 15" is what you are looking at, a good upgrade is the 7200 rpm hard drive, gives a little better performance over the standard 5400 rpm drive.
    The Hi Res screen is good if you do a lot of graphics work.
    Comparing the 13" amd 15" you will notice the 15" has a second, discrete graphic processor...helps when you get into heavy duty videos, games, graphics...but keep in mind that kicking in the second processor uses a lot of power and will run the battery down faster.
    If you are looking at the Retina models, then keep in mind there are no post-purchase upgrade options...you have to buy with everything you want at the start.
    Just some thoughts.

  • Short questions about the focused item

    Hi,
    Short questions about the focused item:
    - How can I check if a specific item has the focus?
    - How can I check in my code which arbitrary item on my form has the focus?
    I need to know this because I have a checkbox and when it become unchecked, I disable an item on my form. But when this item has the focus, disabling this item will fail. Does anyone knows a solution for this problem?
    Greetz
    Eddy

    Hi Eddy!
    I suppose you should make an "event trigger" for the event "et_GOT_FOCUS" in your ItemEvent-handler and store there the item, which initiate that event. It can be like following:
    SBOApp_ItemEvent(FormUID, pVal, BubbleEvent)
    if (pVal.EventType == SAPbouiCOM.BoEventTypes.et_GOT_FOCUS)
       strCurrItemInFocus = pVal.ItemUID;
    do someth..
    if (strCurrItemInFocus == "chbxMyCheckbox1")
       // disabling this item will fail
    else
       // disable an item on my form
    I hope it helps..

  • Questions about the stereo jack p

    Hi everyone,
    I , citizen of the Netherlands,Europe, have some questions about the well known problem stereo jack defect.
    - What is the warranty-period of the Zen Micro , in case my stereo jack will fall out?
    - How to get a RMA and how long will this take to get it done and sent... will it cost me a bomb (sent and repair costs)?
    - Do you get a NEW one back or do they repair the old one for you? As far as i can read it here the chance is big a NEW one will get the same problems one day.. ;P
    By the way, it suprises me that the company is still producing these "wrong" micro's, this problem is known for months!Wouldn't it be cheaper for them to just produce the right ones immediatly instead of repairing them?
    Hope anyone can help me out
    Thanks in advance
    A owner of a Zen Micro White and afraid to get the stereo jack problem one day :P

    Thanks SSR for your reply.
    I was wondering how serious the jack problem actually is... according to the posts here it seems very common to have these problems. But this can be misrepresented because this is maybe just the tip of the iceberg.
    Maybe are there anyone who have the Zen Micro for at least 6 months and WITHOUT any problems?
    thx

  • Questions about the IDE

    Hi all,
    I have some questions about the IDE's Help menu.
    First, without peaking....
    1. Why would you click the Help menu?
    2. What would you expect to find there?
    Now, you can peak
    3. Is there anything in the Help menu that surprises you (gee, I never would have thought to look there for that)?
    4. What is missing?

    That's a reasonable dividing line.  I don't know the official reason myself,
    but I'm glad there are now two forums because I will not lurk on the Flash
    Builder forum because I don't write any of the code for Flash Builder and
    therefore have no "expertise" there.
    I do write code that goes in the Flex SDK and generally know who to bug
    about other code in the SDK I haven't written so if one of my colleagues is
    really busy and not paying attention to forum postings I can point them to
    unanswered posts in their domain of knowledge.
    I would offer that the dividing line is really whether you are having
    trouble with the tools, including the code generated by the tools, or
    whether you are having trouble understanding with the components and
    infrastructure in the SDK.
    One cross-over point would probably be profiling.  Even though I didn't
    write the profiler for Flash Builder, I have lots of experience using it so
    if you are debugging memory leak or performance issues I would ask those
    questions on this forums.  If you are having trouble getting the profiler or
    debugger to run, though, ask that on the Flash Builder forum.

Maybe you are looking for

  • Problem in running a program in Background

    Hi Guys, Execution of a report interactively gave no errors. We tried to schedule job  in background, with variants for the respective cases. But this resulted in the following error in the joblog:   "Error in function module POPUP_TO_CONFIRM"   I kn

  • Acrobat Pro 8.0

    Very early days yet, but so far so good. Finally there is a way (without Extensions) for users with Reader to be able to sign and save dynamic forms. However, can anyone tell me why Acrobat (or Livecycle in the PDF preview) no longer sees the signatu

  • CO-PA forms: how to add a column which is a ratio

    Dear fellows, I'm trying to build a CO-PA form, which has "Product Quantity" (among other several other CO-PA value fields) as a line in the first column. In the second column, I'd like to have each of the other lines (eg. Sales Value, Discounts, etc

  • Hookup MacBook to Toshiba LCD

    I'm trying to hookup my MacBook to our HDTV. On the back of the TV, there is a slot for a SVGA/VGA terminal. I have a cable to run from the TV to the iBook along with a Mini DVI to VGA adapter. After the cables are hooked up and the MacBook is powere

  • PLUG-INS AND SYSTEM MEMORY

    i am using only 2 plug-ins for now,called BFD acoustic drum module by fxpansion and ivory by synthogy. using the activity monitor i have been trying to find out what is causing logic to freeze.it shows the dock shooting as high as 15% CPU for short b