这似乎是一个愚蠢的问题,但为什么我们覆盖equals方法而不是使用新名称创建一个新方法并使用它进行比较?
如果我没有覆盖equals那意味着两者都==等于检查两个引用是否都指向相同的内存位置?
我正在开发一个简单的 Maven + Spring 应用程序,但出现以下错误。它说我的两个班级发生了冲突。所以我删除了第二堂课,但我仍然遇到同样的错误。我尝试重新启动服务器,但它仍然说我的班级存在。有人可以帮忙吗?
Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to parse configuration class [com.nibm.config.RootConfig]; nested exception is org.springframework.context.annotation.ConflictingBeanDefinitionException: Annotation-specified bean name 'employeeController' for bean class [com.nibm.hibernate.controller.EmployeeController] conflicts with existing, non-compatible bean definition of same name and class [com.nibm.controller.EmployeeController]
Run Code Online (Sandbox Code Playgroud)