static method error

Hi!

i'm trying to implement a simple application consisting of this classes:

/*
 * Concesionari.java
 *
 * Created on 14 de abril de 2006, 2:40
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */



package concesionario;

import java.io.*;
import java.util.*;



/**
 *
 *
 */
public class Concesionari {

    String name;
    Store concesionari;
   
   
       
    /** Creates a new instance of Concesionari */
    public Concesionari() {
          this.name = name;
      concesionari = new Store();
   
    }
 

 

public boolean add(Vehicle vehiculo) {
            return Store.add(vehiculo);
      }
 
}



/*
 * Vehicle.java
 *
 * Created on 13 de abril de 2006, 3:59
 *
 * To change this template, choose Tools | Options and locate the template under
 * the Source Creation and Management node. Right-click the template and choose
 * Open. You can then make changes to the template in the Source Editor.
 */

package concesionario;

/**
 *
 * @author jolivan
 */


public class Vehicle {
   
    private float preu;
    private int any;
    private String model;
    private String numplate;
   
   
    /** Creates a new instance of Vehicle */
    public Vehicle(float preu, int any, String model, String numplate) {
                       
        setPreu(preu);
        setAnyFabricacio(any);
        setModel(model);
        setMatricula(numplate);
        getMatricula();
    }
   
   
    void setPreu(float preu) {
    this.preu = preu;
    }
   
    void setAnyFabricacio(int any) {
    this.any = any;
    }
   
    void setModel(String model) {
    this.model = model;
    }
   
    void setMatricula(String numplate) {
    this.numplate = numplate;
    }
   
    String getMatricula(){
        return this.numplate;
    }

}



/*
 * Store.java
 *
 * Created on 15 de abril de 2006, 5:57
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package concesionario;

import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.List;


/**
 * Aggregate of products for sale
 *
 * @author UOC
 * @version 1.0
 */
public class Store {
      /**
       * Product container
       *
       * @see Collection
       */
      private List vehiculos;

      /**
       * By default, the store uses an <code>ArrayList</code> as container
       */
      public Store() {
            vehiculos = new ArrayList();
      }
      
      /**
       * Class constructor. The store is created as the contained implementation
       * is specified (this must have been created)
       *
       * @param products
       *            Container to be used
       * @throws NullCollectionException
       *             The container has not been created
       */
      public Store(List vehiculos) {
            if (vehiculos != null) {
                  this.vehiculos = vehiculos;
            }
      }

      /**
       * Adds a product to the store
       *
       * @param product
       *            Product to add
       * @return <code> true </code> if correct. Otherwise <code> false </code>
       */
      public boolean add(Vehicle vehiculo) {
            return vehiculos.add(vehiculo);
      }

      /**
       * Removes a product from the store
       *
       * @param product
       *            Product to remove
       * @return <code> true </code> if correct. Otherwise <code> false </code>
       */
      public boolean remove(Vehicle vehiculo) {
            return vehiculos.remove(vehiculo);
      }

      /**
       * Shows the list of products in the store.
       */
      public void show() {
            List copy = new ArrayList(vehiculos);
            Collections.sort(copy);
            Iterator iterator = copy.iterator();
            while (iterator.hasNext()) {
                  System.out.println((Vehicle)iterator.next());
            }
      }

}



But when i tried to compile: C:\Documents and Settings\Administrador\Mis documentos\UOC\POO\Concesionario\src\concesionario\Concesionari.java:42: non-static method add(concesionario.Vehicle) cannot be referenced from a static context
                return Store.add(vehiculo);

and i cannot see where is the static context i'm referencing to... can u help me plz? =)

Thanks!
morsa804tonsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CEHJCommented:
You need to have an instance of Store before you can call add on it
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
CEHJCommented:
0
morsa804tonsAuthor Commented:
yes, i finally found it... instance name was "concesionari" and i put Store, instance's type.

Thanx for your help!
0
CEHJCommented:
No problem
0
CEHJCommented:
:-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.