Welcome guest. Before posting on our computer help forum, you must register. Click here it's easy and free.

Author Topic: Java Help  (Read 3100 times)

0 Members and 1 Guest are viewing this topic.

avaricewillkillu

    Topic Starter


    Beginner

    Thanked: 1
    Java Help
    « on: April 30, 2010, 10:22:25 AM »
    I am getting the error
    ImagePGM is the name of my class and constructor.  I just want to know what these errors mean in plain english.

    Exception in thread "main" java.lang.NullPointerException
       at java.io.File.<init>(Unknown Source)
       at ImagePGM.<init>(ImagePGM.java:29)
       at ImagePGM.main(ImagePGM.java:197)

    Thank you

    Geek-9pm


      Mastermind
    • Geek After Dark
    • Thanked: 1026
      • Gekk9pm bnlog
    • Certifications: List
    • Computer: Specs
    • Experience: Expert
    • OS: Windows 10
    Re: Java Help
    « Reply #1 on: May 02, 2010, 10:14:37 PM »
    Quote
    NullPointerException

    You program did not start a valid pointer.
    The pointer was empty.

    BC_Programmer


      Mastermind
    • Typing is no substitute for thinking.
    • Thanked: 1140
      • Yes
      • Yes
      • BC-Programming.com
    • Certifications: List
    • Computer: Specs
    • Experience: Beginner
    • OS: Windows 11
    Re: Java Help
    « Reply #2 on: May 03, 2010, 12:24:24 PM »
    You program did not start a valid pointer.
    The pointer was empty.

    A pointer was empty but it was never started.

    the only "pointers" in java are the object reference pointers, which are object types. for example, you can declare a variable as a ArrayList but unless you set it to an instance of an ArrayList it is a null pointer, and any attempt to access the methods of the variable results in an NullPointerException.

    of course since no actual code was provided it's impossible to determine the exact cause of the issue. the only helpful information here is that it occured in the main() routine.
    I was trying to dereference Null Pointers before it was cool.