Thread: Snytax error
View Single Post
Old Apr 30th, 2008, 3:30 AM   #20
A.K.Al Shamsi
Programmer
 
A.K.Al Shamsi's Avatar
 
Join Date: Mar 2008
Posts: 35
Rep Power: 0 A.K.Al Shamsi is on a distinguished road
Re: Snytax error

i added into

        int z=Integer.parseInt(Option0);
            if (z == 0){// 0 is the number of exiting for the programme
                   break;

it shows unreachable statement in here:
        while(true){// while true starts for looping
        String menu="Enter your Option:\n " ;
        // the menu starts and converting ways of minute, hour, day, year, month, week and year
        String Option1= "1- Convert from Minute to Hour                  2- Convert from Hour to Minute \n";
        String Option2= " 3- Convert from Day to Hour                        4- Convert from Hour to Day \n";
        String Option3= " 5- Convert from Days to Week                    6- Convert from Week to Days \n";
        String Option4= " 7- Convert from Year to Weeks                   8- Convert from Weeks to Year \n";
        String Option5= " 9- Convert from Months to Year                  0- Exit";
        String choose= JOptionPane.showInputDialog(menu + Option1 + Option2+ Option3+ Option4+Option5);
        // to dispaly the menu in input dialog so the user can enter any number from above
        int num = Integer.parseInt(choose);}


so what is the solution??
A.K.Al Shamsi is offline   Reply With Quote