An object for fraction in java