Java example for explain how to use Java class