THANK YOU very much for these tutorials. They are VERY useful in helping me upgrade my coding skills. But while running through Lesson6 I found that my override of the toString() method didn't work. When I ran the JUnit test, as described in the video, it showed me that the PersonTest was using the Object.toString() method, rather than the overrridden toString() method. I tried saving the changes in the Person object (hoping that somehow it would compile on Save), but the error persists. Any suggestions?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi. That sounds a bit strange. You could try removing the toString() method, rebuilding the project, and then adding it back in and rebuilding. It sounds like for some reason the compiler doesn't know you have a toString() method in that class. I guess you could also try something like deleting the entire class and then creating a new Java file for the class. Or possibly just copying in the code from the PDF document. Good luck. Mark
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks Mark.
I did something similar, and it's working now. I closed the project and reopened it, and when I looked at the Person class I saw that the overridden toString() method was missing (for some reason it didn't "register" even though I'd typed it in; might have been because I tried using the quick key to insert it). I retyped it and re-ran the JUnit test and now it works. Thanks for the feedback.
Draykko
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
THANK YOU very much for these tutorials. They are VERY useful in helping me upgrade my coding skills. But while running through Lesson6 I found that my override of the toString() method didn't work. When I ran the JUnit test, as described in the video, it showed me that the PersonTest was using the Object.toString() method, rather than the overrridden toString() method. I tried saving the changes in the Person object (hoping that somehow it would compile on Save), but the error persists. Any suggestions?
Hi. That sounds a bit strange. You could try removing the toString() method, rebuilding the project, and then adding it back in and rebuilding. It sounds like for some reason the compiler doesn't know you have a toString() method in that class. I guess you could also try something like deleting the entire class and then creating a new Java file for the class. Or possibly just copying in the code from the PDF document. Good luck. Mark
Thanks Mark.
I did something similar, and it's working now. I closed the project and reopened it, and when I looked at the Person class I saw that the overridden toString() method was missing (for some reason it didn't "register" even though I'd typed it in; might have been because I tried using the quick key to insert it). I retyped it and re-ran the JUnit test and now it works. Thanks for the feedback.
Draykko