Updated java for defined type