title: integers are not objects in Java, just because they are not instances of a class?
body: <p>There are already some similar questions (e.g. <a href="https://stackoverflow.com/questions/9748882/why-data-type-in-java-are-not-object">Why Data type in java are not object?</a>) but I still not clear.</p>
  
  <p>This is the definition of <code>objects</code> from <a href="http://docs.oracle.com/javase/tutorial/java/concepts/index.html" rel="nofollow noreferrer">oracle's document</a>:</p>
  
  <blockquote>
    <p>An object is a software bundle of related state and behavior. </p>
  </blockquote>
  
  <p>Consider:</p>
  
  <pre><code>int nnn = 3;
  </code></pre>
  
  <p>I think <code>nnn</code> has the type <code>int</code>, and the state <code>my value is 3</code>, although has no behavior. Why it's not an object?</p>
  
  <p>Then look at the following <code>iii</code> which is an object:</p>
  
  <pre><code>Integer iii = new Integer(3);
  </code></pre>
  
  <p>I found some other explanations which says "objects are instances of some class in Java". (Sorry I can't find where I read it)</p>
  
  <p>So the value <code>nnn</code> is not object in Java, the most important reason is it's not an instance of some class?</p>
  
  <p>So that the definition of <code>object</code> in Java should be: An object is a software bundle of related state and behavior, and in Java, it should be an instance of some class. Right?</p>
  
  <hr>
  
  <p>Update:</p>
  
  <p>Thanks for answering my question. I found I need to make this question clear since I found many people didn't notify my explanation in comments, when people commented "it's not an object because it has no behavior".</p>
  
  <p>We know <code>Object</code> has some built-in methods, like <code>toString</code>, <code>equals</code>, etc. So when I define a class, say:</p>
  
  <pre><code>class User extends Object {
    // empty body
  }
  </code></pre>
  
  <p>The instance of <code>User</code> will have these methods(behaviors) too. But what if <code>Object</code> hasn't provide all these methods? In this case, <code>new User()</code> here won't have any methods(behaviors), then we should not consider it's an object?</p>
  
  <p>Sorry guys, I'm really puzzled now :(</p>