Basically, my code is a payroll program that keeps track of an employee's first and last names, salary, and address. I was doing fine up until I made my first object in the main class. My "Employee1" object seems to be the trouble, and I thought it might have been because I didn't have the .txt file in the right folder. I copied the .txt file to every folder of the project because this is my first time using NetBeans and it made so many folders I had no idea which one to put it in. Long story short, if I don't comment out everything involving "Employee1" then the program doesn't run. It gave me something along the lines of "no such element exception" if I remember correctly. I wish I could get the exact phrase but NetBeans won't even let me compile the program right now, so I can't. If anyone can help point me in the right direction it would be greatly appreciated.

We can't help much without having the exception. But if I had to guess, your problem is with the StringTokenizer. Can you provide us with a sample input?

August 28th, 2012, 05:16 PM

bankston13

Re: Need some help with creating a new object

After some time with the program, this is the only error it gives me.

Error: Could not find or load main class PayrollTest
Java Result: 1

I changed the object variable in the PayrollTest class from "Employee1" to "storePayroll" for easier reading. I also added some methods to it, but it can't grab storePayroll in the methods like it can in the main. Sorry, but Netbeans won't let me compile the program for some reason, so I can't post a sample input/output without typing it out.