title: Getting a method not found in class, when I already have the method declared?
body: <p>I'm trying to create objects of the classes I have in the main method, I'm implementing the lazy simpleton pattern, but I keep getting the error cannot find symbol  in class. I've checked to see if I've written the import package statements correctly as well.</p>
  
  <p>This is my main class</p>
  
  <pre><code>package control;
  import java.io.File;
  import java.io.FileNotFoundException;
  import model.ApplicationModel;
  import java.util.* ;
  import model.Shop;
  import view.ApplicationViewer;
  import model.ApplicationModel;
  
  public class ApplicationControl {
     public static void main (String[] args) throws FileNotFoundException{
  
         ApplicationModel apm = new ApplicationModel.getInstance();
  
     }
  
      }
  </code></pre>
  
  <p>This is my Singleton class ApplicationModel</p>
  
  <pre><code>package model;
  // needed for ArrayLists
  import java.io.*;
  import java.util.*;
  import java.util.logging.Level;
  import java.util.logging.Logger; 
  
  public class ApplicationModel {
    private static ApplicationModel instance = null;
  
      private ApplicationModel()
      {
  
      }
         public static ApplicationModel getInstance (){
    if (instance == null){
              instance = new ApplicationModel();
          }
          return instance;
   }
  
      private List&lt;Shop&gt; shops = new ArrayList&lt;Shop&gt;();
      public List&lt;Shop&gt; getShops(){
          return this.shops;
      }
  
      public void setShops(List&lt;Shop&gt; shops){
         this.shops = shops;
      }
  
      public Shop createShop(String csvString){
          String[] attributes = csvString.split(",");
          Shop shop = new Shop(attributes[0],attributes[1],attributes[2],
                  attributes[3],attributes[4]);
          return shop;
          }
  
      public List&lt;Shop&gt; readShops(String shopFileName){
  
              ApplicationModel am = new ApplicationModel();
              List&lt;Shop&gt; shopList = new ArrayList&lt;&gt;();
              try{
              Scanner naughty = new Scanner(new File(shopFileName));
              if (naughty.hasNext()) naughty.nextLine();
              while(naughty.hasNext()){
              shopList.add(am.createShop(naughty.nextLine()));
              }
              } catch (FileNotFoundException ex) {
              Logger.getLogger(ApplicationModel.class.getName()).log(Level.SEVERE, null, ex);
          }
              return shopList;
          }
  
      public String printShops(){
          String listOfShops ="";
          for(Shop shop : shops ){
          listOfShops = listOfShops +'\n'+ shop.toString().trim() + '\n';
          }
           return listOfShops.trim();
          }
  } 
  </code></pre>
  
  <p>Whenever I type in ApplicationModel in the main class, the import statement error stating that the import has not been used goes away too, I'm not sure what's wrong (I'm using netbeans). Can anyone help?</p>