There's so many things wrong here I don't know where to start. I would suggest starting over, write 3-5 lines of code, test it, and only when you're satisfied that they work, go on to doing another 3-5 lines of code, test that, and repeat. Concentrate on your Main class first before even starting on your Average class. You should start off with something like this. And then TEST it thoroughly.