分析:
这里有一个warming,系统照样编译成功,但是最后输出的页面的时候,就显示错误了,这是因为因为studentRepository是私有变量,return的时候,内部可以使用,外部使用的话就不行了。想让外部访问,就要自己定义一个public构造函数,通过赋值给新的变量,才能访问内部的变量的值。

解决Springboot项目Private field XXX is never assigned
解决方法:
解决Springboot项目Private field XXX is never assigned

相关文章:

  • 2021-05-20
  • 2021-04-08
  • 2021-12-31
  • 2021-08-08
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-17
猜你喜欢
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2021-06-19
  • 2021-04-22
  • 2022-12-23
相关资源
相似解决方案