[英]How can I have multiple exception in a single throw java docs tag?
我想在我的代碼中添加一個JavaDoc。 我需要在一次拋出中添加多個異常。 當我在下面添加時,它只識別NullPointerException
而不是IllegalArgumentException
。 有什么方法可以在單個throw標簽中提供多個異常,這樣當我將鼠標放在方法上時它可以識別這兩個異常嗎?
@throws NullPointerException, IllegalArgumentException when invalid userId, timeout is passed
或者我需要這樣做? 通過這個,我重復兩次相同的評論。
@throws NullPointerException when invalid userId, timeout is passed
@throws IllegalArgumentException when invalid userId, timeout is passed
您不能使用1 @throws
標記指定2個例外
你需要每個例外的@throws
標簽。 這允許您為要拋出的每個異常提供描述。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.