title: Java : using objects created in a different class file
body: <p>I'm trying to recreate some board game on Android and I'm stuck with the use of objects.</p>
  
  <p>I basically have one main activity class, which does all the UI changes and calculations, but I have to create the cards somewhere. I can do it with no problem in the main activity after creating a WonderCard class somewhere else.</p>
  
  <p>Here's WonderCard.java :</p>
  
  <pre><code>package com.example.phil.test3;
  
  public class WonderCard {
  
      int id;
      String name_full;
      String name_short;
      int view_path;
  
  public WonderCard(int id, String name_short, String name_full, int view_path) {
      this.id=id;
      this.name_full=name_full;
      this.name_short=name_short;
      this.view_path=view_path;
  }
  
  }
  </code></pre>
  
  <p>And here's the object construction in the main activity :</p>
  
  <pre><code>card = new WonderCard[] {
                  new WonderCard(0,"Olympia","La Statue de zeus à Olympie",R.mipmap.wondercard_0),
                  new WonderCard(1,"Gizah","La Grande Pyramide de Gizeh",R.mipmap.wondercard_1),
                  new WonderCard(2,"Rhodos","Le Colosse de Rhodes",R.mipmap.wondercard_2),
                  new WonderCard(3,"Babylon","Les Jardins Suspendus de Babylone",R.mipmap.wondercard_3),
                  new WonderCard(4,"Alexandria","Le Phare d'Alexandrie",R.mipmap.wondercard_4),
                  new WonderCard(5,"Halikarnassos","Le Mausolée d'Halicarnasse",R.mipmap.wondercard_5),
                  new WonderCard(6,"Ephesos","Le Temple d'Artémis à Ephèse",R.mipmap.wondercard_6),
          };
  </code></pre>
  
  <p>(sorry about the French)</p>
  
  <p>So this all works, and from my main activity I only have to call, say, </p>
  
  <pre><code>card[0].name_long
  </code></pre>
  
  <p>to get an object's property.</p>
  
  <p>Everything is fine for now, except I'll have to create more than 150 cards at some point. I want to keep my main activity as clean as possible and would like to get rid of the object construction 150 lines high in my main activity.</p>
  
  <p>My question is : how can I create my cards and their properties on a <strong>different file</strong>, and call those created objects easily from my main activity file ?</p>
  
  <p>(Android allows me to use an SQLite database, if it may help)</p>