What is wrong with this code?

Joined
Jul 21, 2010
Messages
2
Reaction score
0
Can any one please tell why I am getting a Null Pointer Exception for this particular code? And also how I can make it work?

It's a constructor.

public puzzle(int number_of_disks, int pause_time) {
disks = number_of_disks;
time = pause_time;
source = new LinkedStack();
for(int i=disks; i>0; i--){

source.push(i);
}

}


Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,078
Messages
2,570,572
Members
47,204
Latest member
MalorieSte

Latest Threads

Top