String config ="applicationCotext";
// 创建容器对象
ApplicationContext alc = new ClassPathXmlApplicationContext(config);
Student student =(Student) alc.getBean("student");
System.out.println(student);
}
可能是ide的项目缓存导致的,可以试一下:左上角的文件(file)->清除缓存/重启->选择清除缓存并重启
我又仔细看了一下,代码出现了问题,修改之后还是未能解决,但经过很多次很多次的重启之后,能运行了,