Q:

Null Pointer Exception for Java

I'm currently getting started with the use of LWJGL for making java games and I'm in the middle of making a basic pong-like game.  However I keep getting a NullPointerException on this line.   
paddle.move(1)

the full command is:
private GOPlayer paddle;
public void getInput(){
    if(Keyboard.isKeyDown(Keyboard. KEY_W))
        paddle.move(1);
}

GOPlayer.move is:
    public static final float SPEED = 4f;
    public void move(float mag){
        this.y += SPEED * mag;
}

I did initalize paddle
objects = new ArrayList<GameObject>();
GOPlayer paddle = new GOPlayer(0, Display.getHeight()/2 - GOPlayer. SIZEY/2, null);
objects.add(paddle);

I just can't seem to figure it out, it's probably something really obvious as usual. 

A:

If this is all of your code, paddle can only be null as it hasn't been initialized. 
Do something like private GOPlayer paddle = new GOPlayer(); or similar, depending on how you create GOPlayer objects. 
And in reaction to your initialization: instead of GOPlayer paddle = new GOPlayer(0, Display.getHeight()/2 - GOPlayer. SIZEY/2, null);, do paddle = new GOPlayer(0, Display.getHeight()/2 - GOPlayer. SIZEY/2, null); as you have already declared paddle as you seem to want to use the field (private GOPlayer paddle) but you create a new local variable instead...

