Variable Error on getFinishedBooks method


#1



https://www.codecademy.com/courses/learn-java/projects/personal-library


Library.java:33: error: cannot find symbol
getFinishedBooks.myLibrary(myBooks);
^
symbol: variable getFinishedBooks
location: class Library
1 error


import java.util.HashMap;
class Library {
  
  public Library(){
    
  }
  
  public void getFinishedBooks(HashMap<String, Boolean> library){
    
    if(library.size()<1){
      System.out.println("Error! HashMap is empty.");
    }
    
    else {
      
      for(String book : library.keySet()){
        
        if (library.get(book) == true){System.out.println(book);
                                      }
      }
    }
  }
                               
  public static void main(String[] args){
    HashMap<String, Boolean> myBooks = new HashMap<>();
    myBooks.put("Road Down The Funnel", true);
    myBooks.put("Rat: A Biology", false);
    myBooks.put("TimeIn", true);
    myBooks.put("3D Food Printing", false);
    
    Library myLibrary = new Library();
    
    getFinishedBooks.myLibrary(myBooks);
  }                           
}


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.