It's not really typecasting in java