Solved

NullPointerException

Posted on 1998-07-22
3
211 Views
Last Modified: 2010-05-18
I recently download a working applets and after running it without changing any codes, it give me an Java.Lang.NullPointerException error.

Anbody know why error is this and what causes it?
0
Comment
Question by:wizlor
  • 2
3 Comments
 
LVL 1

Accepted Solution

by:
dryang earned 100 total points
ID: 1227791
This is something from the JDK 1.1.6 documentation.

public class NullPointerException
extends RuntimeException

Thrown when an application attempts to use null in a case where an object is required. These
include:

    Calling the instance method of a null object.
    Accessing or modifying the field of a null object.
    Taking the length of null as if it were an array.
    Accessing or modifying the slots of null as if it were an array.
    Throwing null as if it were a Throwable value.

Applications should throw instances of this class to indicate other illegal uses of the null object.

This can be cause by a few things
1) Bad programming practices, where the programmer does not take care with
      - arry lengths
      - vector sizes
      - accesing empty Vectors. eg using the elementAt mehtod.( I did theis before :) )

2) Exception cases
     - plain bad luck when your data length values get corrupted and your pointers point to nowhere(did they mention that java had no pointers?)...

do go over the codes and see if you can spot the bug (usually in the looping sections, for and while loops)

regards
0
 

Author Comment

by:wizlor
ID: 1227792
Thx for your help.
0
 
LVL 1

Expert Comment

by:dryang
ID: 1227793
hi wizlor,
you're welcome
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now