When I type "how to write to a file" I got the same java result but I don't use java.
True for me as well: the first hit is for python (my language of preference), but then they are all Java (which I don't use). Seems like this specific query has a lot of clicks for java, which makes this specific example not so useful.
However, I have felt how Google uses my search history for better results during my queries, so I still agree it is a behavior that I find convenient.
I realized after posting this that Java is a bad example since it is so popular. But there was a time where I primarily used Scala and generic queries quickly brought me to Scala results so Google is definitely trying to figure it out.
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.