Java Programming/Exceptions/NullPointerException

From Wikibooks, the open-content textbooks collection

Jump to: navigation, search

NullPointerException Null Pointer Exception: This is an exception that is thrown when a command trys to access a variable and use it while it is null when it cannot be used as such. Suggestion: try to find where the variable is supposed to be defined or define it in a try:catch:final block.