You do not check to see if the user pressed 'y', only if he/she did not press 'n'. So any character other than 'n' will continue the loop. You need to add another loop to check which character is pressed, something like:
do {
System.out.println("If yes press 'y' or no 'n'");
m=s.next().charAt(0);
if (m == 'y' || m == 'n')
break;
} while (1);
} while(m == 'y');