confused class and java