Advertisement
Guest User

Untitled

a guest
Jul 28th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.34 KB | None | 0 0
  1. public boolean contains(String name) {
  2.         // Default to false
  3.         boolean isTrue = false;
  4.         // If the index at i has a song, compare it the Song's name, if it
  5.         // matches, return true
  6.         for (int i = 0; i < songNames.length; i++) {
  7.             if (songNames[i] == name) {
  8.                 isTrue = true;
  9.             } else{
  10.                 return false;
  11.             }
  12.         }
  13.         return isTrue;
  14.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement