The method clear() is undefined for the type ShoppingCart

后端 未结 3 1632
南方客
南方客 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:13

    If that method was newly added and you get this error, you're apparently still using an old version of the class lacking the method in the classpath. You need to save the source code file, recompile/rebuild the class/project, redeploy the project and restart the server to get the new changes to work.

    A bit decent IDE with a bit decent server plugin will do that automagically by the way.

提交回复
热议问题