-1
我目前正在春天編寫一個服務類中的方法,但編譯時出現意外的標記錯誤消息。我在代碼中看不到任何問題。 PFB的代碼。Java中的意外標記問題
@Service
public class HelloService{
@Autowired
HelloDao helloDao;
public Long getName(Long id) {
Person person = helloDao.findName(id);
return person.getName();
}
}
每當我創建一個新的方法,這個錯誤信息就會出現,而不管我創建的類是什麼。 對此有何想法?
請易讀性縮進代碼,告訴我們確切的錯誤信息,並告訴我們在哪兒錯誤發生。 – Andreas
'person.getName()'是否真的返回一個'Long'?這聽起來不合邏輯。 – Jesper
是的,我剛剛改寫了我的代碼。即使我的字符串類型不起作用 – Yogesh