Using Stringvariables with switch-Keyword ?

Hallo !
I am a JAVA newcomer from Austria.
I know the Keyword switch and case,
but it is not possible to compare Stringvariables.
Is there an other command to do this or
how do you compare Stringvariables with the case-Statement ?
Thank you for your answer.
Wolfgang KLD

Hmmm....
From Java Lang Spec 2 14.10:
  SwitchLabel:
     case ConstantExpression :
  The type of the expression must be char, byte, short or int...
.From Java Lang Spec 2 15.28:
  A compile-time constant expression...following:
     Simple names that refer to final variables whose
     initializers are constant expressions.
.And this doesn't compile (with jikes nor jdk 1.3)
    static final int h1 = "value1".hashCode(); 
    static void test() throws Exception
     String s = "value1";
     switch(s.hashCode())
       case h1: System.out.println("value1 it is");
       default:
          System.out.println("no such luck");
     It must be the phrase 'whose initializers are constant expressions' that does it in.

Similar Messages

  • Why doesn't the rotate gesture on my trackpad behave as it used to for switching between tabs when it works the same with all other programs besides Firefox?

    Why doesn't the rotate gesture on my trackpad behave as it used to for switching between tabs when it works the same with all other programs besides Firefox?
    I changed the about:config to make the rotate gesture move between tabs, and it worked great for well over a year. Now it behaves erratically as described here:
    https://bugzilla.mozilla.org/show_bug.cgi?id=877598
    It used to be very controllable to move one tab over, now it is erratic and moves quickly and to unexpected tabs regardless of how slow I do the rotate gesture. This is the main reason I use Firefox over Chrome and I would like to continue to do so unless there is no fix to this.

    Just set the browser.gesture.twist.threshold to something around 15-25.

  • Use of KVM switch with an IMAC

    Have a new IMAC and wanted to use my existing IOGEAR KVM switch. Normally, the two computers plug into the switch and from the switch to the computer. Since the computer and monitor are all one, is this still possible - or how do I use this with the IMAC?

    You show that you are running Tiger. This is the Leopard forum.
    I suggest reposting in the iMAC forum regardless. It is not a Leopard issue it is a hardware question.
    http://discussions.apple.com/category.jspa?categoryID=132

  • What are the pros and cons of using people keywords, given that my catalogue is already uptodate with regular keywording of all subjects?  e.g., will the people keyword transfer to other programs?, can I use the same name for a people keyword and regular

    What are the pros and cons of using people keywords, given that my catalog is already up to date with regular keywording of all subjects?  e.g., will the people keyword transfer to other programs?, can I use the same name for a people keyword and regular keyword in the same photo?

    What are the pros and cons of using people keywords, given that my catalog is already up to date with regular keywording of all subjects?  e.g., will the people keyword transfer to other programs?, can I use the same name for a people keyword and regular keyword in the same photo?

  • Using AbleNet intelliswitch with switch control?

    I am attempting to interface AbleNet IntelliSwitch to Yosemite Accessibility Switch Control on MacBook Pro to use a button switch as a click and enter.  I have that set in the Intellitools software, but Mac is not recognizing it at all points when tested by manually moving the mouse pointer and then clicking with the external switch.

    The IntelliSwitch is so old - I don't think it will work with Switch Control. The only thing you might try is seeing if it will work without the driver installed. Intellitools is meant to be used with Discover Envoy and it just may be that if you try it without the software, it might work.
    Don't get your hopes up though. If you'd like me to recommend some switches that I know work with Switch Control, let me know.

  • Using Windows 7 and LR 5  when I look at the Keyword List a certain keyword has 7 pictures but when I check the Library Filter with that keyword 350 pictures are shown which includes the 7 pictures that have the keyword.  Why does the Library Filter showi

    Using Windows 7 and LR 5,  when I look at the Keyword List a certain keyword has 7 pictures but when I check the Library Filter with that keyword 350 pictures are shown which includes the 7 pictures that have the keyword.  Why does the Library Filter showing pictures that do not match the query

    Dan,
    Here's what's going on in the catalog you sent me, "Joel & Caitlin's Wedding".  There is the keyword "gwenn", which is explicitly assigned to 7 pics. But keyword "schwartz" has a number of synonyms, including "gwenn", and it is assigned to 25 pics.  There is no overlap between the two sets of pics. 
    I discovered these two occurrences by doing Metadata > Export Keywords, opening the exported file in an editor, and then searching for "gwenn".  I found two occurrences of "gwenn":
    gwenn
    schwartz
        {gwenn}
    From this, you can see that the keyword "schwartz" has 9 synonyms, of which "gwenn" is one.
    The filter criterion "Keywords Contain gwenn" will match the 7 pics that are explicitly assigned the keyword "gwenn", and it will also match the 25 pics assigned the keyword "schwartz", because that keyword has a synonym "gwenn".
    This illustrates the behavior I mentioned above: The criterion "Keywords contains x" will match against any of a pic's assigned keywords, any of those keywords' ancestor keywords, and any of the synonyms of the assigned keywords and their ancestors.
    So LR is operating correctly here, if not in a way that's easy to understand. 
    It appears that you are using the synonyms of "schwartz" to represent individual members of the Schwartz family.  A better way of representing family relationships is to have a parent keyword "Schwartz", with subkeywords for each family member, e.g. "Gwenn Schwartz", "Joe Schwartz", "Jane Schwartz", etc.  Repeating the family name in the subkeywords has a couple of advantages. LR usually only displays the "leaf" name of a keyword, so instead of showing you just "Joe", it will show you "Joe Schwartz", helpful when there are a number of different people whose first name is "Joe".  Also, if you ever export your pics to other software, it may not understand the LR hierarchy and won't show the parent keywords, so again it's more informative to see a keyword named "Joe Schwartz" rather than "Joe".

  • Using -pack + -standalone switches with Weblogic ?

    Hi,
    Does anyone know as to whats the issue with using -pack + -standalone switches with Weblogic ? Its been mentioned in the documentation that its not advisable to use those in combination when we build and EAR. We have been doing this in our project for atleast a month now and have not come across any issue due to this.
    Please share your thoughts.
    Thanks,
    -Naga

    Hi,
    Does anyone know as to whats the issue with using -pack + -standalone switches with Weblogic ? Its been mentioned in the documentation that its not advisable to use those in combination when we build and EAR. We have been doing this in our project for atleast a month now and have not come across any issue due to this.
    Please share your thoughts.
    Thanks,
    -Naga

  • Using Lightroom publish service for either Flickr or SmugMug. I have many images with a keyword Madd

    Using Lightroom publish service for either Flickr or SmugMug. I have many images with a keyword Maddy. This frequently doesn't show up in SmugMug or Flickr. All my other keywords seem to work fine. Anybody experience anything like this?

    You only get one opportunity to set up the hard drive under publish and the folder cannot be changed unless you get a plug-in to provide a work around.
    However you could just create a generic publish folder - something like Photo Lab, or Print Job.
    But you could then right click on your publish folder and select “make target collection” - you will see the plus sign added.
    Simply highlight the photos you want to print and press B (the same as adding to a quick collection) and your Publish Services folder on your hard drive will be populated with the exports.
    The real problem is that you would need to edit the publish settings every time you required different dimensions etc (not sure possible). I use a similar system, which works well and I like how I can see what has already been published and what is still to be published but my prints are always the same size and resolution.
     

  • How to use a KVM switch with my IMAC

    Have a new IMAC and wanting to use my KVM switch - is there a way to use it?
    Thanks,

    Zimmer1956 wrote:
    Have a new IMAC and wanting to use my KVM switch - is there a way to use it?
    If you mean you want to send video from another computer to the iMac display,
    the answer is: NO WAY. iMacs have no video input; the mini-DVI is output-only.
    If you want to send iMac video to a shared external monitor, it might work -- if
    you can find a KVM switch for a USB keyboard & mouse.
    Looby

  • How to use a KVM switch with a Pavillion 23

    I have a Pavillion 23, and it has no VGA port, but it does have a USB port.
    I have another machine that is not an all in one pc, and I was hoping to use a KVM switch to use the Pavillion 23's video monitor capabilites, and just toggle between it and my other machine. I have a USB to VGA converter. Can this work? Will this create some sort of infinate loop? I have a sneaking suspicion that I need a 2nd usb to VGA converter. Am I right?

    Hi,
    This will be the out port, not in port therefore you can't use the 23" monitor.
    Regards.
    BH
    **Click the KUDOS thumb up on the left to say 'Thanks'**
    Make it easier for other people to find solutions by marking a Reply 'Accept as Solution' if it solves your problem.

  • How to use iPhoto with 1 photo library and 2 user accounts on 1 iMac ?

    Title says it all.
    I don't want to have a double picture library, it takes enough space from my harddisk already.
    My wife and I share the same camera too. We want to see the same pictures when using iPhoto.
    Possible solution: Do I have to make a softlink from 1 user account to the photo lib that belongs to the other account ? [in Terminal:  ln /Users/.... etc.)
    (Yes, I'm an ex-Linux user)
    Thnx
    Fred4711

    If you want to have the same data, do you need separate accounts? A surprising number of people think that must have separate ccounts and they really don't need to.
    Anyway:
    For iPhoto 09 (version 8.0.2) and later:
    What you mean by 'share'.
    If you want the other user to be able to see the pics, but not add to, change or alter your library, then enable Sharing in your iPhoto (Preferences -> Sharing), leave iPhoto running and use Fast User Switching to open the other account. In that account, enable 'Look For Shared Libraries'. Your Library will appear in the other source pane.
    Any user can drag a pic from the Shared Library to their own in the iPhoto Window.
    Remember iPhoto must be running in both accounts for this to work.
    If you want the other user to have the same access to the library as you: to be able to add, edit, organise, keyword etc.
    Quit iPhoto in both accounts. Move the Library to the Users / Shared Folder
    (You can also use an external HD set to ignore permissions, a Disk Image or even partition your Hard Disk.)
    In each account in turn: Double click on the Library to open it. (You may be asked to repair the Library Permissions.) From that point on, this will be the default library location. Both accounts will have full access to the library, in fact, both accounts will 'own' it.
    However, there is a catch with this system and it is a significant one. iPhoto is not a multi-user app., it does not have the code to negotiate two users simultaneously writing to the database, and trying will cause db corruption. So only one user at a time, and back up, back up back up.

  • Find images with parent keyword tag only?

    I don't know how to describe this problem succinctly, so I don't know how to search for it in the knowledgebase or forums. Can anybody help?
    I want a keyword hierarchy with "US" as parent keyword of 50 states name keywords. I have many images with state keywords, but I also have some images that are tagged only with "US" but no state tag, as they are not specific to a state.
    How do I *easily* find only the images tagged "US" but with no state tags? Clicking on "US" in the keyword panel shows me all images tagged with "US" and all with state tags, but I just want the ones tagged "US".
    I can use "Find" to find "US" images NOT CONTAINING "AL AK AR AS AZ..." by enumerating all 50 states, but that's a terribly awkward way filter out images tagged with state names. I can't see a button or filter that shows only the images with a parent tag but without child tags
    Any ideas?
    Thanks ahead of time,
    Dave

    John, this seemed like a great idea.  I tried it, and it seemed to work.  There was an immediate problem because when there are lots of keywords it means a lot of scrolling and it can be hard to locate rail among rain rate rails etc. because the font is so small.  A second problem was that you are forced to mouse scroll - cant page down or up or use home or end. That can be a lot of scrolling. a third problem is that it seems you have to reselect flat view each time.
    a more serious problem is that it seems to have stopped working.  I'm not quite sure what i did but i have a keyword verb with 5 items and about 1125 child keywords (such as to sing to run etc.) for 1125 photos   i click on the verb arrow in the keywords so i bring up 1125 pictures of verbs.  now i go to metadata switch to flat view.  i can now see "verb" as a keyword in the metadata panel, but when i click on it, nothing happens - I still have 1125 selected photos.  Furthermore i cannot click on any other keyword in the metadata panel - that is nothing happens when i click.  if I return it to hierarchical view it is fine.  then Lightroom 4 64-bit stopped working.  when i restarted the program it was still in flat view and i was now able to click on the metadata panel and see appropriate collections.  then it stopped working again after i clicked on the keyword panel (but did not actually select anything).  in total i have about 3000 keywords and about 100000 photos on local and network drives.  it looks to me like flat view has some serious problems, but perhaps its something i am doing.... 
    i also have to say that even if it worked perfectly, i still might prefer other solutions because scrolling up and down for 3000 keywords can be tedious - its difficult to prevent overshooting and undershooting the mark.  if the keyword and metadata panels could be undocked that would probably be a big help.

  • Text search returns results with some keywords, but not others

    This pertains to a tours website for Turkey. I've sucessfully
    set up a search form, and results page which returns results when
    multiple keywords are entered. Everything is working well, except
    when certain keywords are used. For example, the table column being
    searched for is called long_itinerary, so if anyone is interested
    in a certain site or city, it's bound to be in the long itinerary
    somewhere.
    Here's the problem, by example: When someone searches with
    the keywords Antalya, Konya, Ankara, or Adana, for example, results
    are returned from the database, and those keywords are in each
    returned tour's long itinerary.
    But certain keywords return nothing, even when they're in
    practically all of the tours, in the long_itinerary column. For
    example, Istanbul, Ephesus, and Izmir, Kusadasi and Pergamum return
    no results, even though they're there. I've gone through all of the
    most likely keywords, and these are the offenders. If, for example,
    I search with "Istanbul Ankara," I get results with tours including
    Ankara (and Istanbul, but only because the word "Ankara" is in the
    itinerary).
    First I made sure the Charset values were the same on the
    search form page and the results page. Still had the problem. Next,
    I went into the database itself, and copied the word "Istanbul"
    directly from the long_itinerary column of the database, and pasted
    it into the search function's text field, and searched again. Same
    problem--no results returned.
    I can't see any difference between the keywords which work
    correctly, and those which don't, what baffles me is that even when
    I copy a keyword directly from the database and paste it in the
    search text field, it returns no results!
    Well, I'm baffled! Any ideas what might cause this?

    Hmm -- one of my customers is a turkish building company
    (Kusadasi BTW), and when *they* add some contents to the DB,
    they´ll be entering turkish chars. It´s in particular the
    turkish "I" which is pretty different, and this is when a search
    for keywords containing a western "I" will fail.
    Could that be the problem in your case ?

  • Why do I get "Evaluation Expired" message in MAX with Switch Executive

    Why do I get �Evaluation Expired� message in MAX with Switch Executive on a PXI rack, which has a �Ghosted� image from and identical PXI rack(no problem with this PXI rack), when logged in as USER in Windows2000, but not when logged in as a Local Administrator. When logged in as Administrator in Windows2000 running a TestStand sequence, using a �C� code action step calling the nise.dll is ok, but not when logged in as local user. The alias switch name is unknown.

    1.0.4.109 is a dll version number where as 1.0.2 is a NISE version number. The dll version number does not always line up with the product version number.
    NISE 1.0 has a dll version of 1.0.1.109
    NISE 1.0.1 has a dll version of 1.1.4.1
    NISE 1.0.2 has a dll version of 1.2.4.7
    NISE 2.0 has a dll version of 2.0.0.45154
    The best way to find the product number is to launch the application and click on Help and About. You NISE version is probably 1.0 and NISE 1.0.2 will fix your licensing problem.

  • I'm hooked up to the ethernet using DHCP with manual address. It's running (green) but my internet (Safari, messenger, email) doesn't work! Help!

    I'm running an iMac with Mountain Lion. Not only do we do accounting work on this computer with AccountEdge, but the computer functions as a server to another computer in a different state.
    Anyway, I set a static IP address (Using DHCP with manual address) on it (to allow for a VPN to the computer in the different state) and it is connected (green dot) - meaning that the other computer in the different state can connect to us via that ethernet line - but for some reason Safari, Messanger, and Apple Email won't work.
    But if I switch a dynamic IP (DHCP auto), I can use the internet (Safari, messanger, email), but the computer in the different state can't connect to this computer.
    How can I fix this so that the computer in the different state can connect to this computer and that the internet (Safari, messanger, and email) can work at the same time?
    Much thanks!

    No but if they are using a VPN Tunnel for the connection that restricts all internet traffic over the tunnel. Which means you can't use that same computer to broswe the internet or connect to other computers or devices on your LAN.
    I'd need to see the actual setup, router and the IP addresses you are using.
    Networking and remote networking is fairly easy when you are in front of the systems you are working on. Doing it over the internet on a forum is almost impossible. Tha is why I suggested you get local help, like the person that originally set it up.

Maybe you are looking for

  • Adobe Bridge Auto-Start when Flash Card plugged in

    If this is the wrong forum, my appoligies.... I am using Adobe Photoshop CS2 with Max OS X 10.4.8 on a PowerBook. When I plug in a flash card reader (with a card) than Adobe Bridge automatically starts and this is not what I want - I just want to ope

  • Usb 3.0 driver for windows 7 64 bit hp 23-b011 all in one

    I have a hp 23-b011 that is a all in one computer. I downgraded the operating system to windows 7 64 bit because I prefer windows 7. Anyhow I need my usb 3.0 driver to work . I have tried the driver SP57875 it does not work. also have tried do the %t

  • All flash videos are working except this one!?

    Tonight a friend of mine tried to watch this video: http://www.globalmaritimes.com/video/index.html But, it will not work on her Vista laptop. So I tried everything, I uninstalled flash, reinstalled it, changed various internet settings, etc. I tried

  • How to make own crop marks in indesign CS5

    Halo Master .. I want to make a scrip cropmark own use javascrip..cropmark standard InDesign only but I want to add a colorbar itself using PDF File I have added a scrip function myDisplayDialog(){     var myDialog = app.dialogs.add({name:"CropMarks"

  • Connecting To Wireless Speakers

    This one is really bursting my brain. Bought my daughter a set of Vega Wireless Speakers with iPod dock. Now I have tried everything to get the iPod to play through the speakers and the only way it will do this is with the Aux cable provided with the