Write in java when variables appear