A small program for a java assignment