Code Room
Code reviewMediumcr-g525
Subject Error handlingLevel Entry–Mid~14 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Java code that reads the first line of a file.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewjava
String firstLine(String path) throws IOException {    BufferedReader r = new BufferedReader(new FileReader(path));    String line = r.readLine();    r.close();    return line;}
Run or narrate your approach, then ask the coach.