title: Why will it always be a null value?
body: <p>Okay I got the following class, but item is always null when I <code>GetIstance();</code> Visual studio shows:</p>
  
  <p><code>Field 'PageStyle.item' is never assigned to, and will always have its default value null</code></p>
  
  <p>How can I resolve this? What am I doing wrong? Is there a better way of doing whats done below?</p>
  
  <pre><code>public class PageStyle
  {
  
  private static PageStyle _Instance = null;
  
  // Instantiate variables relating to sitecore item paths.
  Database webDB;
  Sitecore.Data.Items.Item item;
  
  // constructor
  private PageStyle()
  {
      if (webDB != null)
      {
          webDB = Sitecore.Configuration.Factory.GetDatabase("web");
          Sitecore.Data.Items.Item item = webDB.Items[StartItem];
      }
  }
  
  // Method that gets instance
  public static PageStyle GetInstance()   
  {       
      if (_Instance == null)          
      _Instance = new PageStyle();        
      return _Instance;   
  }
  
  private void InitializeWebDB()
  {
     if (webDB == null)
     {
      webDB = Sitecore.Configuration.Factory.GetDatabase("web");
     }
  
  }
  
  private void InitializeStartItem()
  {
      if (webDB != null)
      {
          item = webDB.Items[StartItem];
      }
  }
  
  public string StartItem
  {
      get
      {
          return _startItem;
      }
  
      set
      {
          _startItem = value;
      }
  }
  }
  </code></pre>