How to resolve this error "parseInt cannot be resolved" ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Neo chericj
    New Member
    • Jan 2011
    • 2

    How to resolve this error "parseInt cannot be resolved" ?

    in Line:
    Code:
     Scanner s = new parseInt.Scanner(System.in);
    i've included util.Scanner already...
    ur help is greatly appreciated...
  • nathj
    Recognized Expert Contributor
    • May 2007
    • 937

    #2
    Hi,

    parseInt is not a class and so it cannot be instantiated. parseInt is actually a method on the Integer class so if you wish to use it I think you need to do:
    Code:
    String number = "12";
    int numeric = Integer.parseInt(number);
    Take a look at the API

    Thanks
    nathj

    Comment

    • Neo chericj
      New Member
      • Jan 2011
      • 2

      #3
      got rid of it..

      nextInt(); did it...

      thnx,
      - chericj

      Comment

      Working...