private String badSampleString = new String ("Literal"); ⁄⁄悪い例 private String fixedSampleString = "Literal"; ⁄⁄良い例
public boolean validate (String userInput) { if(userInput != null && userInput.equals("y")) { return true; } return false; }
public boolean validate (String userInput) { if("y".equals(userInput)) { return true; } return false; }
public boolean checkHead (String checkString) { if (checkString.length > 0 && checkString.charAt(0) == 'E') { return true; } return false; }
System.getProperty("line.separator") System.getProperty("file.separator")