title: Java: array attribute in object
body: <p>I am a newbie in Java programming and was just wondering if you can do this:
  I have a object class Person:</p>
  
  <pre><code>public class Person {
  
      public String name;
      public String[] friends;
  }
  </code></pre>
  
  <p>If yes how to initialse it, i.e. </p>
  
  <pre><code>newPerson.name = "Max"; 
  newPerson.friends = {"Tom", "Mike"};
  </code></pre>
  
  <p>I tried to do it like that, but it does not work.</p>