spring 里的@autowired 在service里写了 还用写setter方法吗

2025-03-22 21:55:51
推荐回答(2个)
回答1:

@Autowired声明在field上时不需要写setter方法. 至于getter方法跟这个无关.

回答2:

不需要写