Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Data Structures Efficiency! Custom Serialization

Sean Flanagan
Sean Flanagan
33,235 Points

Problems with Karaoke class

Hi. I've picked up some errors with my Karaoke class.

import com.teamtreehouse.model.KaraokeMachine; //error here
import com.teamtreehouse.model.Song;
import com.teamtreehouse.model.SongBook;

public class Karaoke {
  public static void main(String[] args) {
    SongBook songBook = new SongBook();
    songBook.importFrom("songs.txt");
    KaraokeMachine machine = new KaraokeMachine(songBook); //2 errors here
    machine.run();
    System.out.println("Saving book...");
    songBook.exportTo("songs.txt");
  }
}

Errors:

Karaoke.java:1: error: cannot find symbol                                                        
import com.teamtreehouse.model.KaraokeMachine;                                                   
                              ^                                                                  
  symbol:   class KaraokeMachine                                                                 
  location: package com.teamtreehouse.model                                                      
Karaoke.java:9: error: cannot find symbol                                                        
    KaraokeMachine machine = new KaraokeMachine(songBook);                                       
    ^                                                                                            
  symbol:   class KaraokeMachine                                                                 
  location: class Karaoke                                                                        
Karaoke.java:9: error: cannot find symbol                                                        
    KaraokeMachine machine = new KaraokeMachine(songBook);                                       
                                 ^                                                               
  symbol:   class KaraokeMachine                                                                 
  location: class Karaoke                                                                        
3 errors 

Any help as ever would be appreciated. :-)

1 Answer

Joseph Anderson
Joseph Anderson
10,617 Points

KaraokeMachine is not in the model package/folder so you need to remove "model" form the import Statement, I believe.