What is your favorite programming language?
Since we are talking about a Java position, it's obvious that your favorite language is Java. But if such a question arises, then it is meant to reveal whether you are Java-addicted or an open-minded person. In other words, the interviewer considers that it's hard to work with rigid people who are addicted to one programming language and want to use it exclusively in all situations. Being a Java developer doesn't mean that you should consider Java for all your tasks and ignore everything else. So, a good answer might be, Obviously, I am a big fan of Java, but I also consider it important to pick the best tool for the job. It is absurd to believe that Java is the answer to all problems.