Keep getting   " identifier expected" error

I keep getting that error, but I have not code which requires use of an <identifier>. I've been staring at this screen for like 3 hours now and I cant figure it out...Any help is greatly appreciated
public class ConTest
        Scanner scan = new Scanner(System.in);
        char c = 'z';
        String choice;
        String temp;
        System.out.println("Choose one of the following operations:");
        System.out.println("    - Infix to postfix conversion (enter the letter i)");
        System.out.println("    - Postfix expression evaluation (enter the letter p)");
        System.out.println("    - Arithmetic expression evaluation (enter the letter a)");
        System.out.println("    - Quit (enter the letter q)");
        while(c != 'q' && c != 'Q'){
            System.out.println("Which operation do you want? ");
            choice = scan.nextLine();
            c = choice.charAt(0);
            switch(c)
                case 'A':
                case 'a':
                    System.out.println("Input your infix expression:\n");
                    temp = Converter.infixToPostfix(scan.nextLine());
                    System.out.println("The value of the arithmetic expression is " +
                        Converter.postfixValue(temp) + "\n");
                    break;
                case 'I':
                case 'i':
                    System.out.println("Input your infix expression:\n");
                    System.out.println("The postfix expression is " + Converter.infixToPostfix(scan.nextLine())
                        + "\n");
                    break;
                case 'P':
                case 'p':
                    System.out.println("Input your postfix expression:\n");
                    System.out.println("The value of the postfix expression is " +
                        Converter.postfixValue(scan.nextLine()) + "\n");
                    break;
                case 'Q':
                case 'q':
                    System.out.println("quitting\n");
                    break;
                default:
                    System.out.println("Invalid choice\n");
}It's just some code to test my infixToPostfix and postfixValue static methods of a separate class.

System.out.println("Choose one of the following operations:");How do you expect this line of code (and the ones following it) to be executed? They are not inside any valid place. They need to be in a method, constructor, or initializer block (and maybe I left out a couple of other terms, but the point is you have these lines of code in an illegal place.

Similar Messages

  • I keep getting the following error message when I try to update my itunes, "There is a problem with this windows installer package. Aprogram run as part of the set up did not finish as expected.  Contact your support personnel or package vendor."

    I keep getting the following error message when I try to update my itunes, "There is a problem with this windows installer package. Aprogram run as part of the set up did not finish as expected.  Contact your support personnel or package vendor."

    Yes, I had found a similar solution also.  I'm running XP Pro, SP3.  I went Control Panels/ Add-Remove programmes/apple software update/ change/ repair.  Then run the 10.5 exe.
    While the programme updated from version 8 of iTunes, my new iTunes is now a mess.  Not all of my music was in the same folder previously but it all showed up on iTunes.  Now many albums have been left out, some have only a few tracks and some have two copies of some tracks as well as having other tracks missing.  I haven't begun to work on that.

  • HT201328 after unlocking from ATT and resetting iphone 3gs I keep getting the same error message "could not activate phone" neither Apple Store Tech or ATT were able to fix this . Any ideas?? TKS Sandro

    after unlocking over the phone from ATT and resetting iphone 3gs I keep getting the same error message "could not activate phone" neither Apple Store Tech or ATT were able to fix this .
    Itunes displays a message saying "there is no SIM installed in the phone you're trying to activate" even if there is the same SIM that was working minutes before.
    The SIM works on a different phone I tested it.
    Any ideas?? TKS Sandro

    “Could Not Activate EDGE” error message Update ...
    Well it’s going on day 6 and still sporadic to no EDGE on my iPhone. At one time, it was thought to be a defective iPhone – since my partner’s iPhone works just fine.
    After over three hours on the land line with AT&T and Apple, I was sent to the local Apple store for a replacement. Of course, as soon as I walked into the Apple store my iPhone worked just fine. ;-( The local store replaced my iPhone and suggested I go home and activate the phone as a NEW iPhone, that way if there was a bug in my data it would not carry over to the new phone. Did that and well… still sporadic to no EDGE. By the way, I have the Big White “E” to the right of the 5 bars and AT&T .
    AT&T said last week they has “Software” issues in my area, but the CSR I talked to did not know what the issues were or if they were the cause of my problems. He did say they would call me back today to see how my iPhone was doing, but alas, no call back.
    When I’m next to my partner, trying to access the same feature, his iPhone is just so fast. Mine hangs up, draws out and finally I get the error message, “Could Not Activate EDGE”. I am updated to version “1.1.4(4A102)”. New (refurbished) iPhone direct from Apple.
    I remember reading a while back about some problems others had when they upgraded to from 1.1.3 to 1.1.4. I never had those problems, but it sure looks like they may have started. Does anyone remember what the problems with 1.1.4 were, what was done if anything to correct them, and best of all any suggestions?
    By the way, this is Seattle, not some small – out of the way place where connection and signal strength is expected to be second rate. Also, I had full function of my iPhone from the day I bought it in June 2007, all the way up to Thursday March 20, at 2120.
    Thanks
    Joe

  • I keep getting the follow error messages when I try to sign into iTunes store or redeem a song code: We could not complete your iTunes store request. The network connection could not be established. There was an error in the iTunes store, please try again

    I keep getting the following error messages on my Mac when I try to redeem a song code: "We could not complete your iTunes store request. The network connection could not be established. There was an error in the iTunes store, please try again later."  and then, "We could not complete your iTunes Store request. An unknown error occurred (-50)."

    Hello, constance132. 
    Thank you for visiting Apple Support Communities. 
    Here are some troubleshooting steps that I could recommend when receiving error -50. 
    "Error -50," "-5000," "8003," "8008," or "-42023"
    These alerts occur due to timeouts or conflicts trying to write a file during download.
    If you encounter this issue while accessing iTunes Store:
    See iTunes 9: "One Moment Please" or "Error (-50)" message when accessing iTunes Store
    If you encounter this issue while while downloading something from the iTunes Store:
    Delete your iTunes Downloads folder, located in:
    Mac OS X:
  ~/Music/iTunes/iTunes Media/Downloads   Note: "iTunes Media" may appear as "iTunes Music. Also, the tilde (~) refers to your Home directory.
    Windows Vista:
  \Users\username\Music\iTunes\iTunes Media\Downloads\
    Windows 7:
  \Users\username\My Music\iTunes\iTunes Media\Downloads\
    Windows XP:
  \Documents and Settings\username\My Documents\My Music\iTunes\iTunes Media\Downloads\
    After locating your iTunes Downloads folder:
    Quit iTunes.
    Delete the Downloads folder on your computer.
    Open iTunes.
    Choose Store > Check for Available Downloads.
    Enter your account name and password.
    If you encounter this issue while while downloading Digital Copies using Windows:
    Use MSCONFIG (directions for Windows XP and Windows Vista/Windows 7) to disable conflicting software.
    If using MSCONFIG steps resolves the issue, you may want to use the System Configuration Utility to turn on the third-party System Services and Startup Items one at a time (restarting your computer after turning on the item or items) to identify which System Service or Startup Item is causing the conflict.
    You can turn all of them back on by selecting the Normal Startup option under the General tab of the System Configuration Utility window, but please note that this may cause the issue to reoccur.
    If you are able to isolate the issue to a particular third-party software, you may wish to contact them to let them know of the conflict.
    iTunes: Advanced iTunes Store troubleshooting
    http://support.apple.com/kb/TS3297
    Cheers,
    Jason H. 

  • Why do I keep getting an unknown error 4002.

    Why do I keep getting an unknown error 4002. I seems to happen 5 or 6 times a day. iTunes seems to be working fine but it's kind of annoying. The window pops up and says "We could not complete your iTunes Store request." It tells me that there was an error in the iTunes Store and should try again later. I click OK but it just won't stop.

    Mike Enders wrote:
    I already tried that.  First I get this:
    Then when I click on Keep Contacts, I get this:
    I don't want my calendars and reminders deleted from my iMac.  I would rather have them deleted from iCloud, since I never intended to use iCloud to begin with.  The fact that my calendars and reminders are available on other devices that use iCloud is no good to me because I have no other Apple devices.
    You may not have 'intended' to use iCloud but you did. Backup your contacts and calendars, sign out and restore your data.
    Now that you have published your email address in a public space you can expect the spammers to have it, I will ask for it to be removed but we're probably too late.

  • HT1338 tried to update 10.7.4 to 10.7.5 get un expected error at cleanup....have tried several times with no success..after failed try mail will not open because the mail is now incompatible with 10.7.4......HELP

    tried to update 10.7.4 to 10.7.5 get un expected error at cleanup....have tried several times with no success..after failed try mail will not open because the mail is now incompatible with 10.7.4......HELP

    2009 MacBook Pro eh? It looks like your hard drive has failed. Three years is pretty standard. Often, then only hint you have is catastrophic failure.
    If you put the old hard drive into an external enclosure or similar device, you may still be able to migrate your data from it. Just because it won't boot doesn't mean you can't still read from it. Still, I wouldn't keep trying it. As long as you are buying a new hard drive, may as well get sometime to use with Time Machine too.

  • I keep getting the message Error 1722 when I install JRE.

    I keep getting the message:
    Error 1722.There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor.
    When I try to install this on my computer which is XP and I don't know how to get it on to my computer. I need it for an application and it won't work unless I get JRE on my computer.

    Refer to the JDK Installation Instructions. The error is discussed at the end. (The JRE Installation Instructions says refer to the JDK instructions for troubleshooting.)

  • I can not sync my iPhone to the computer. I keep getting up an error message that synchronization does not want to start. I have uninstalled iTunes and then reinstall it. But the same warning box will appear. How can I get my phone in sync again?

    Can someone please help me get my iPhone to sync to your computer?
    I can not sync my iPhone to the computer. I keep getting up an error message that synchronization does not want to start. I have uninstalled iTunes and then reinstall it. But the same warning box will appear. How can I get my phone in sync again?

    Hello lenmin,
    Thanks for using Apple Support Communities.
    To help resolve this issue where you're repeatedly prompted to authorize with your Apple ID in iTunes when syncing, please follow the directions in the article below.
    iTunes: Missing folder or incorrect permissions may prevent authorization - Apple Support
    Have a great weekend,
    Alex H.

  • I keep getting a popup error message in Ical "server does not recognize name/password

    I keep getting a popup error message in Ical "server does not recognize name/password"  This started after they did the change to Icloud and extended our subcriptions. 
    Tricia

    I guess that the server name is incorrect, then.
    Did it ever work?
    Delete the account, reboot the phone, then add it back and be sure you choose Yahoo as the mail server type. Everthing should then fill in automatically except your user name and password.

  • I am trying to order a book, I keep getting the same error message," A network error occurred while processing your order, please check your network connection and try again"

    I am trying to order a book with iphoto, I keep getting the same error message.
    " A network error occurred while processing your order, please check your network connection and try again"
    I get the billing part up, it has even uploaded my jpegs but at the final process, I get the same message.
    I have ordered two books a few months ago without any problems.
    Now I keep getting the same message either half way into
    the order or at the final hurdle after the images have been uploaded.
    Any ideas?
    My shared Network has been fine and that does'nt seem an issue.
    Help.

    Try again in a couple of hours - sometimes it is a temp condition
    LN

  • TS3212 I tried to update my iTunes, but I keep getting a runtime error  R6034 Attempt to run C runtime library incorrectly.    I also got an Error 7 (Windows error 1114)

    I tried to update my iTunes, but I keep getting a runtime error R6034 attempt to run C runtime library incorrectly.  I also got an Error 7 (Windows error 1114).  Now my currently iTunes will not open.

    Hey twhitten!
    Here is an article that will help you troubleshoot this issue:
    iTunes 11.1.4 for Windows: Unable to install or open
    http://support.apple.com/kb/TS5376
    Take care, and thanks for visiting the Apple Support Communities.
    Cheers,
    Braden

  • I am running Windows 7  and trying to update to iTunes version 10.5 (from version 10.3.1.55) and I keep getting the following error message, 'Error occurred while installing the updates. If the problem persists, choose Tools Download Only and try instal

    I am running Windows 7 home edition and trying to update to iTunes version 10.5 (from version 10.3.1.55) and I keep getting the following error message, ‘Error occurred while installing the updates. If the problem persists, choose Tools > Download Only and try installing manually’ which I do only to have the same error message pop up.

    Try updating your iTunes using an iTunesSetup.exe (or iTunes64Setup.exe) installer file downloaded from the Apple website:
    http://www.apple.com/itunes/download/

  • I am trying to send an iMovie project to iDVD and I keep getting the following error msg.  "Unable to prepare subject for publishing:  The project could not be prepared for publishing because an error occurred. (-43)"

    I am trying to send an iMovie project to iDVD and I keep getting the following error msg.  "Unable to prepare subject for publishing:  The project could not be prepared for publishing because an error occurred. (-43)"

    Check out this thread: https://discussions.apple.com/thread/1421870
    It may mean you either your Event or your Project. Have you moved any of the files in the Finder by any chance? That error may come up if you moved anything outside of iMovie. Do you get an error message when you choose Share>Export to iMovie (choose medium size) and save it to the Desktop? If you can export it to the desktop, you can pull that file into iDVD separately and still make it work.

  • I keep getting the following error message while sharing my iMovie to iDVD.  "Unable to prepare project for publishing"  error (-2125).

    I keep getting the following error message while sharing my iMovie to iDVD.  "Unable to prepare project for publishing"  error (-2125).  I'm running iMovie 09 v. 8.0.6 on a iMac with OSX v 10.6.8, 2Ghz core duo, 1GB 667 Mhz DDR2 SDRAM.  Any ideas why?

    That particular error comes up for a number of reasons, sometimes it's the size of the movie you're trying to export. Bengt Wärleby a longtime contributor to the iMovie Discussion Group has advised a number of people on this error code, so I am going to link to his latest advice he's given to anyone trying to export to DVD from iMovie: Bengt's tips for great DVDs.
    Specifically, try bypassing Share to iDVD by using Share to Media Browser instead.
    In the Share to Media Browser dialog box choose the Large Size.
    When(If?) it gets through that process, quit iMovie altogehter then go to iDVD.
    Create a new project and click on the Media button near the lower right hand side of the Project Window.
    Then click the Movies button in the Browser window just above that.
    Under the iMovie star icon you should see the name of the project you shared out from iMovie.
    Drag that into the project and burn the DVD.
    If it's still to large or you get the same -2125 error code trying to Share using the Medium size instead. But again if you really get stuck consult Bengt Warleby's User tips:
    Bengt's tips for great DVDs

  • HT1338 I keep getting a Networking Error: when i run Software update. i have 10.5.8 and want to upgrade to at least 10.6 or later. i know the network is working perfectly.

    I keep getting a Networking Error: when i run Software update. i have 10.5.8 and want to upgrade to at least 10.6 or later. i know the network is working perfectly.

    Snow Leopard OS 10.6 is not available via Software Update, it is paid upgrade.
    Start by checking if you can run Snow Leopard:
    Requirements for OS X 10.6 'Snow Leopard'
    http://support.apple.com/kb/SP575
    OS 10.6 Snow Leopard is available for $19.99 from the Apple Store:
    http://store.apple.com/us/product/MC573/mac-os-x-106-snow-leopard
    and in the UK:
    http://store.apple.com/uk/product/MC573/mac-os-x-106-snow-leopard
    but nobody knows for how long it will be available.
    When you have installed it, run Software Update to download and install the latest updates for Snow Leopard.
    To use iCloud you have to upgrade at least to Lion, but some functions are only available in Mountain Lion:
    http://support.apple.com/kb/HT4759
    You can also purchase the code to use to download Lion (Lion requires an Intel-based Mac with a Core 2 Duo, i3, i5, i7 or Xeon processor and 2GB of RAM, running the latest version of Snow Leopard), or you can purchase Mountain Lion from the App Store - if you can run that:
    http://www.apple.com/osx/specs/

Maybe you are looking for