68

Is there (not NotImplementedException, not supported).

ripper234
  • 222,824
  • 274
  • 634
  • 905
  • 3
    +1: Simple question but something I needed to know asap. – hopia May 12 '12 at 03:13
  • 1
    possible duplicate of [Is there anything like .NET's NotImplementedException in Java?](http://stackoverflow.com/questions/2329358/is-there-anything-like-nets-notimplementedexception-in-java) – agentnega Feb 13 '14 at 04:44

2 Answers2

95

java.lang.UnsupportedOperationException

Or, if you use Apache Commons Lang and the operation should be supported, but has not been implemented (yet?):

org.apache.commons.lang.NotImplementedException

oxbow_lakes
  • 133,303
  • 56
  • 317
  • 449
Thilo
  • 257,207
  • 101
  • 511
  • 656
  • Great. Now all that remains is that this will be the #1 Google result for "notsupportedexception java" – ripper234 Jun 30 '09 at 10:32
  • Not implement is exactly not what I wanted btw, I want an exception that explicitly states I never intend to implement this method. – ripper234 Jun 30 '09 at 10:33
  • 3
    We've got Jon Skeet on our side for that one. – Matthew Scharley Jun 30 '09 at 10:39
  • 1
    For me it is hit number eight now: http://www.google.co.jp/search?q=notsupportedexception+java – Thilo Jul 01 '09 at 01:18
  • 11
    Just so you guys know, I just googled "java NotSupportedException" and this turns up #1 – chakrit Sep 05 '10 at 17:40
  • 1
    I googled "java NotSupportedException" and this turned up #2. #1 was http://stackoverflow.com/q/2329358/792238 :) – Siddhartha Sep 10 '13 at 16:16
  • 2
    Four years after it was written, this question is still relevant. It came up #1 in my Google search, which is great, but the surprising part is that it was written by @ripper234 back when we were working together. In fact, he was probably sitting in the exact same room as I'm in right now when he wrote it. Yay for progress! – Avish Oct 27 '13 at 11:45
  • @Avish - I have a knack for asking good questions, this is how I built my StackOverflow reputation :) I'm glad this was useful for you! – ripper234 Oct 27 '13 at 13:36
1

You can use either UnsupportedOperationException or NoSuchMethodException or extend the Exception class and create your own custom exception called NotImplementedException or whatever

user121803
  • 177
  • 1