Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

12
  • 32
    What can you throw in Java? Commented Dec 14, 2012 at 17:12
  • 2
    using the suggestion from the link @jschoen provided (disable the byte code verifier) you can throw something which doesn't extend Throwable! described in my answer below. Commented Dec 14, 2012 at 17:42
  • 4
    This excerpt from aioobe's answer sums up the question @jschoen linked quite well: "I.e., your question can be interpreted as 'If a JVM deviates from the specification, can it do weird stuff such as throwing primitivs' and the answer is of course, yes." Commented Dec 14, 2012 at 18:26
  • 2
    @Max - Can you elaborate on practical uses for this? Commented Dec 15, 2012 at 20:36
  • 3
    how about an exception that rethrow itself on the finalize()? Commented Dec 16, 2012 at 8:53