title: java: ClassCastException - [Ljava.lang.Long; cannot be cast to java.lang.Long
body: <p><em>I use red5 and setting/getting attributes using the IConnection class, but that's really not relevant.</em></p>
  
  <p>'L' means long in java. so 0L is 0 type Long instead of just '0' which is 0 type Integer.</p>
  
  <p>What is the difference between <code>[Ljava.lang.Long</code> and <code>java.lang.Long</code> in the following error message:</p>
  
  <pre><code>stack trace: java.lang.ClassCastException: [Ljava.lang.Long; cannot be cast to java.lang.Long
  </code></pre>
  
  <hr>
  
  <p><strong>update</strong></p>
  
  <p>code sample:</p>
  
  <pre><code> static Long getLongAttribute(IConnection conn, String attribute) {
      Long result=null;
      try {
          if (!conn.hasAttribute(attribute))
              throw new Exception(attribute +  " - Long attribute not found!");
        result = conn.getLongAttribute(attribute); // &lt;--- ERRROR ON THIS LINE
      } catch (Exception e) {
          _handleException(e);
      }
      return result;
  }
  </code></pre>