Solved

What to do to NullPointerExeption?

Posted on 1997-03-27
1
177 Views
Last Modified: 2010-04-16
My Java-code gives "java.lang.NullPointerExeption".
Please tell what usually makes it, and why it comes
also when I have "commented" almost everything out (only Thread and while-loop left).
0
Comment
Question by:sanct
1 Comment
 
LVL 3

Accepted Solution

by:
pc012197 earned 10 total points
ID: 1219276
A NullPointerException is generated when you try to access a method or variable in the 'null' object. Usually it is caused by accessing reference variables without assigned them to an object first.

0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question