Arraylist indexOf always returns -1 Java


I'm doing a project for class in which you have to make a Hall of Fame and be able to add/remove/search/edit different kinds of bands. Right now, I'm having trouble with searching the index for a specific band because it always returns -1 and I'm not sure why.

Here is my code:

public class HallofFame
    public static ArrayList<Band> hallOfFame = new ArrayList<Band>();
    public static Scanner scan = new Scanner(;
    public static void main(String[]args){
        int a = 0;
        while(a == 0){
            System.out.println("What would you like to do?");
            System.out.println("1. Add");
            System.out.println("2. Remove");
            System.out.println("3. Edit");
            System.out.println("4. Clear");
            System.out.println("5. Search");
            System.out.println("6. Quit");
            String choice = scan.nextLine();
            if(choice.equals ("1")){
            else if(choice.equals ("2")){
            else if(choice.equals ("3")){
            else if(choice.equals ("4")){
            else if(choice.equals ("5")){
            else if(choice.equals ("6")){

    public static void add(){
        Scanner booblean = new Scanner(;
        System.out.println("What is the name of the band you would like to add?");
        String name = scan.nextLine();
        System.out.println("What kind of genre is this band?");
        String genre = scan.nextLine();
        System.out.println("How many members are in the band?");
        int numMem = scan.nextInt();
        System.out.println("How many songs does this band have?");
        int numSongs = scan.nextInt();
        System.out.println("How many albums does this band have?");
        int numAlbs = scan.nextInt();
        System.out.println("Is this band currently active?");
        String yesno = booblean.nextLine();
        boolean isActive = false;
        if(yesno.equalsIgnoreCase ("yes")){
            isActive = true;
        Band b1 = new Band(name, genre, numMem, numSongs, numAlbs, isActive);
        System.out.println("The band " + name + " has been added to the database.");

    public static void remove(){


    public static void edit(){
        System.out.println("What band info do you want to edit?");
        String searchband = scan.nextLine();

    public static void clear(){

    public static void search(){
        System.out.println("What band name are you searching for?");
        String searchband = scan.nextLine();
        int retval = hallOfFame.indexOf(searchband);
        System.out.println("The band " + searchband + " is at index: " + retval);

    public static void quit(){

The search method is the one I'm having trouble with.

The problem is that hallOfFame contains Band objects, but you're searching hallOfFame for a String. Instead, iterate through hallOfFame and compare band names to the inputted string.