Using multiple classes in Java