Pergunta de entrevista da empresa Walmart Global Tech

particular use of some keywords in java .. that help with encapsulation and immutability.

Resposta da entrevista

Sigiloso

14 de set. de 2021

My answer included quick discussion on these where I mentioned about these topics. I believe the interviewer was incorrect in assessment here that there can be a performance improvement to using these keywords. Performance improvement maybe a 0.1% use case for these but neither is it published to improve performance by oracle or any other of the multiple books on the subject. If the interviewer has special knowledge in the context of the first question where adding encapsulation and immutability keywords improves any JIT / GC measurable performance I request them to write a blog open for comment. As far as I am aware the compiler can optimize code effectively and the major use of those particular keywords is to convey intent to other developers and users of your code. Also to reduce bugs introduced in code. The interviewer was not able to communicate their reasoning for their belief.

1