The method clear() is undefined for the type ShoppingCart

后端 未结 3 1634
南方客
南方客 2021-01-13 16:25

I am implementing a shopping website through JSP. I have a Java object called ShoppingCart and one called Item. In ShoppingCart there is a vector w

3条回答
  •  再見小時候
    2021-01-13 17:01

    I was just fighting a very similar problem in Eclipse. I deselected "Project->Build Automatically" option and I was clicking "Project->Clean" and cleaning the project, but the error wouldn't go away. Finally, in the dialog that pops up after clicking "Project->Clean", I deselected the "Start a build immediately" option and did a clean.

    It then FINALLY "really" cleaned the project and cleared the error. Then I started a build and all was fine.

    At one point I had commented out the offending line and saved, and Eclipse was still reporting the error on that line!!! I don't know if this is an Eclipse bug or an underlying tool chain bug, but it's definitely not doing the write thing.

    This was with Eclipse Helios Service Release 2 and a Java SE 6 target. Running under Windows XP.

提交回复
热议问题