Is there anything like .NET's NotImplementedException in Java?

后端 未结 5 800
北海茫月
北海茫月 2020-12-02 04:23

Is there anything like .NET\'s NotImplementedException in Java?

5条回答
  •  猫巷女王i
    2020-12-02 05:18

    You could do it yourself (thats what I did) - in order to not be bothered with exception handling, you simply extend the RuntimeException, your class could look something like this:

    public class NotImplementedException extends RuntimeException {
    
        private static final long serialVersionUID = 1L;
    
        public NotImplementedException(){}
    }
    

    You could extend it to take a message - but if you use the method as I do (that is, as a reminder, that there is still something to be implemented), then usually there is no need for additional messages.

    I dare say, that I only use this method, while I am in the process of developing a system, makes it easier for me to not lose track of which methods are still not implemented properly :)

提交回复
热议问题