So I was under the impression that any mistake made in programming could quite trivially be undone by undoing it…I just found out that that isn’t the case!
I am working on a big school java coding project that is due tomorrow, and I wanted to change the list type of the list variable in a particular class. I clicked on the value inside of the <> brackets, and (I don’t know why I just didn’t do find and replace) I selected the value, and hit refactor.
I wanted to change the text to String. I don’t know what it did, but its bad. Basically every time a String is used in my program (like every class), it is underlined in red and won’t work. All of my classes are covered in red now. The error message by each is the same:
method setString in interface java.sql.PreparedStatement(or whatever method I am using) cannot be applied to given types
required: int,java.lang.String
found: int,myPackage.String
Anybody have any thoughts on the matter? Somehow, I am using Strings from my package, and not the java.lang package, but no imports were altered. It was a silly thing for me to do, I just hope I can undo it and get back to working on this project.
Thanks!!
It looks like you’ve created your own class called String and it is shadowing the core Java String class. Rename your String class to something else.