Solved

NullPointerException

Posted on 1998-07-22
3
210 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

757 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

21 Experts available now in Live!

Get 1:1 Help Now