-1
 import java.io.*;
    class Test2
    {
        public static void main(String []args) throws IOException
        {
            String number = "90";
            int value;

            value = Integer.parseInt(number); //change number to an integer
            System.out.println(value);
        }
    }

I get the error .\Integer.java:19: cannot resolve symbol

symbol: method parseInt(java.lang.String)

Location: class Integer

number = Integer.parseInt(inData);

It is saved as test2, not Integer, so I don't understand the error.

Brennan C
  • 13
  • 2
  • You've got your own class close by that you've named `Integer` and in doing so, you're confusing the Java compiler. Re name this class *now*. – Hovercraft Full Of Eels Apr 18 '18 at 15:13
  • I'm still new to coding, so where did I make that class, the only one I see is the Test2 class. This isn't the only code that doesn't work. I have other work that only starting giving this error recently – Brennan C Apr 18 '18 at 15:16
  • Hell if anyone of us know. Only you can see the other classes that you have near by. Check things out and see. Otherwise re-build and clean your project. – Hovercraft Full Of Eels Apr 18 '18 at 15:16
  • Thank you, that's what it was. There was a file someone else created that I didn't know about. Thanks a lot for your help :) – Brennan C Apr 19 '18 at 14:55

1 Answers1

0

If you do not have a class named Integer, doing this would not throw any error. You likely have a class named Integer. Renaming this class would remove the error.

Raymo111
  • 514
  • 8
  • 24