0

what i am trying to do here. is to let the user type a hexadecimal number

http://en.wikipedia.org/wiki/Hexadecimal

and then display it.

import java.io.*;
class Ex23
{
          public static void main(String[] args)
          {
           Console console=System.console();
           System.out.println("please type a hexadecimal number");
           String input;
           input=console.readLine();
           int number;
           int number=Integer.parseInt(input);
           int count=0;
           char c= input.charAt(0);
           c= console.readline(input);           
           String abc= "abcdef";
           
           
           if(c!=number)
             
                while(c==abc.charAt(count))
                 {
                 number2=count+9;
                 count++;}
                      
                System.out.println(number2);
            
           else
            
                System.out.pringln(number);
           
         
         }
}

it tells me that there is an else with no if.. why is that?

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by stephen84s
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.