There seem to be a couple questions here which could cast things in a decidedly better/worse light.
If the test is open book, then "I can't manage to look up how to deal with stdin and stdout in Java" is decidedly more damning than "I can't remember".
Further, if there is a requirement that you use the same language for all of the answers, choosing Java when you know Java best makes sense. If not, choosing for that problem Java (when you don't firmly remember how to do normal IO!) is itself a bad decision, when you likely would have got full marks for
If the test is open book, then "I can't manage to look up how to deal with stdin and stdout in Java" is decidedly more damning than "I can't remember".
Further, if there is a requirement that you use the same language for all of the answers, choosing Java when you know Java best makes sense. If not, choosing for that problem Java (when you don't firmly remember how to do normal IO!) is itself a bad decision, when you likely would have got full marks for