title: Why Java class not loaded?
body: <p>when i debug the following code, I encountered a problem：</p>
  
  <pre><code>HotelDomainPrefixUtil.HotelB2BDomainPrefix = Class not loaded: com.xxx.xxx.HotelDomainPrefixUtil
  </code></pre>
  
  <p>The code are following:</p>
  
  <pre><code>public class HotelDomainPrefixUtil {
  public static List&lt;String&gt; hotelB2BDomainPrefixList;
  static {
      hotelB2BDomainPrefixList = some initalization code
      }
  }
  </code></pre>
  
  <p>I use <code>HotelDomainPrefixUtil</code> like this：</p>
  
  <pre><code>public String generatePrefix(DomainGenerateParam domainGenerateParam) {
      for (Iterator&lt;String&gt; iterator = HotelDomainPrefixUtil.hotelB2BDomainPrefixList.iterator(); iterator.hasNext(); ) {
  
      }
      // some code
  }
  </code></pre>
  
  <p>I don't know where a error happens? But when I change my code like this:</p>
  
  <pre><code>    List&lt;String&gt; hotelB2BDomainPrefixList = HotelDomainPrefixUtil.hotelB2BDomainPrefixList;
      for (Iterator&lt;String&gt; iterator = hotelB2BDomainPrefixList.iterator(); iterator.hasNext(); ) {
      //some code
      }
  </code></pre>
  
  <p>and I debug my code, everything is ok. But why?</p>