why do we need to write this in java?