Few more questions in java and python