How to use Java Object