Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public boolean contains(String name) {
- // Default to false
- boolean isTrue = false;
- // If the index at i has a song, compare it the Song's name, if it
- // matches, return true
- for (int i = 0; i < songNames.length; i++) {
- if (songNames[i] == name) {
- isTrue = true;
- } else{
- return false;
- }
- }
- return isTrue;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement