Learning how to use java. Mostly homework