answersLogoWhite

0

throw is the keyword used to invoke the exception.

throw new NoBalanceException("No balance please");

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

Can NullPointerException be used with ArithmaticException using throws keyword in java?

No. You cannot throw or catch Null pointer exceptions


Why use catch keyword in java?

no, because catch is used to handle exceptions which are generated from try block


When wil you need throws keyword in java?

The throws keyword will be used in method declaration to signify the fact that, some pieces of code inside the method may throw exceptions that are specified in the method signature.


What is the function of this in java?

this in java is a keyword that refers to the current object of the class. It is also used in constructor overloading when you want to invoke one constructor from another within the same class.


What keyword are used in java for exception handling?

The important keywords used in Java with respect to Exception Handling are: a. Throw - The "throw" keyword is used to throw exceptions from inside a method b. Throws - The "throws" keyword is used to signify the fact that the code contents within the current method may be throwing an exception and the calling method must handle them appropriately


What is the use of try in java?

The try keyword is used in Java to handle problematic situations that are commonly known as "Exceptions" The try keyword is used in conjunction with the catch keyword. If any exception is thrown by code inside the try block, they will be caught and handled by the catch block. Ex: try { ... ... } catch (Exception e){ ... }


What types of values can be thrown in java?

Only instances of subclasses of throwable can be used in conjunction with the throw keyword. In java all exceptions and errors are subclasses of throwable.


What is the significance of the keyword "sha ta co ti oh" in the context of a specific cultural tradition or practice?

The keyword "sha ta co ti oh" is significant in the context of the Choctaw tribe's stickball game. It is a chant used during the game to invoke the spirits of their ancestors and bring good luck to the players.


Which equation is not used in the derivation of the keyword?

The equation that is not used in the derivation of the keyword is the quadratic formula.


Can both the keyword and the question be used for three"?

Yes, both the keyword and the question can be used for three.


Is in is used as a keyword in C language?

Neither "in" nor "is" is a keyword in C.


Which protocol is used to invoke web services?

Wsdi.soap.uddi