java - How to throw RuntimeException ("cannot find symbol") -
I am trying to throw an exception in my code like this:
RuntimeException Throw (msg);
But when I create a netban I get this error:
c: \ .... java: 50: not symbol symbol Can get: method runtime exception (Java.lang.String) location: class ... runtime exception (msg) throw; 1 error
Do I need to import something? Do I have this misspelled? I'm sure I should dumb something: - (
New runtime expiry (msg) )
You need to have the new
in it. This is making an example and throwing it, not calling a method.
Comments
Post a Comment