I wouldn't regard the language of an answer as particularly important in many cases. I quite often search for information about Android or iOS, which I'm programming in C#. And often the questions and answers are in Swift, Objective-C, Java or whatever. They still give me the information I need. And sometimes people have added additional C# answers to questions that were framed in Swift or Java - and those are even more helpful to me. Occasionally questions were phrased in Xamarin/C#, but they got a Swift/Java answer, explaining the OS function to use: those are also helpful. So answers that don't match my language, and/or don't match the question language are still perfectly useful.
In general, the crux of many questions revolves around either: the concept of how to implement an algorithm; or the OS commands to use to achieve something. In both cases the language used isn't particularly important, and indeed pseudo-code may be quite adequate for the first. Questions where the meat of the question involves some technical detail of the language itself (such as details of type casting, inheritance, etc.) are probably rather in the minority.
So please don't go around the site deleting every, otherwise accurate, answer you find in the "wrong" language. Such vandalism would remove plenty of content that is useful to me.
That's not to say that answers in the correct language aren't better. And in some cases the details of the language are important, and might render an answer largely useless.
In the specific case you mention, you say it asks about an algorithm, and Java was only mentioned as a tag. It seems likely, therefore, that readers will find the question via Google quite easily if they are using other languages. There's a good chance many, possibly even a majority, of the people arriving on the page are NOT using Java.
If the question wasn't good and already has numerous good answers, the answers in your case might be rather useless - but only because they are more fluff on a bad question.
And finally, regarding policy, my understanding was that inaccuracy was not a grounds for deleting an answer at all? Rather it should be downvoted, ideally with a comment explaining why the answer is wrong.