Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Why wont my Class carries variables work? :( HELP PLZ

Status
Not open for further replies.

KohlerChris

Programmer
Jul 8, 2001
5
AU
OK im a Begginer programmer working on my school assignment and my teacher knows nothing about java, my problem is when i create my class PlayerInfo like this
public class PlayerInfo{

Then in my main program i use it like this
PlayerInfo player = new PlayerInfo();
also later on in the program i use commands to input vales into it which works
eg player.InputPlayerXpos(4);

But later on in it i use my output method
eg x = player.OutputPlayerXpos();
and i get a null pointer exception
can somone tell me why my class is not keeping the variables in it? it it because it is not a thread and it just dies after everytime i use it? do i have to make it a thread? if so how do i keep the thread alive? what od i do ?
because i have already made my program around this PlayerInfo class
plz help pplz
 
Seems like there are some problems in your PlayerInfo class but it might be due to your main class too. You will have to post your codes onto the forum or if the programs are too long.

Only that way, then we can solve the problem.

Regards,
Leon

If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best :)
 
Yeah Dude i Sent u a email also if u have icq can you add me 30452337
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top