teratail header banner
teratail header banner
質問するログイン新規登録

回答編集履歴

1

boolean型の判定が誤っていましたので修正します。

2017/09/18 04:14

投稿

baseballyama
baseballyama

スコア316

answer CHANGED
@@ -26,8 +26,8 @@
26
26
  // スキャナーを閉じる
27
27
  sc.close();
28
28
 
29
- // 部分一致か判定
29
+ // 部分一致か判定(boolean型は == true などの記載は必要ない)
30
- if (isPartialMatch(S, W) == true) {
30
+ if (isPartialMatch(S, W)) {
31
31
  System.out.println(W + " is " + "partial match of " + S + ".");
32
32
  } else {
33
33
  System.out.println(W + " is " + "NOT partial match of " + S + ".");