This is not how you compare strings in Java.
There is also a logical error in the code, since the line cannot be Y and N at the same time, you should use &&instead ||. As long as the selection is neither Y nor N, you want to continue the loop. If this is any of them, you want to stop. So, the &&right choice.
, , .equals(obj)
while (!loopChoice.equals("Y") && !loopChoice.equals("N")) {
, == , . (, , , ) , .equals .
NullPointerException , :
while (!"Y".equals(loopChoice) && !"N".equals(loopChoice)) {