View Single Post
Old 02-26-2013, 08:20 PM   PM User | #1
trancecommunity
New Coder

 
Join Date: Feb 2013
Posts: 36
Thanks: 8
Thanked 0 Times in 0 Posts
trancecommunity is an unknown quantity at this point
non-static method addCar() cannot be referenced from a static context

Trying to call this function. Point being it adds an object called carNew into an array and increases total by 1. Then returns a "true" that can print out a success message.


Code:
boolean ok = CarShowRoom.add(carNew);
Code:
public boolean add(Car carIn)
    {

        if ( !isFull(total) ){

            cars[total] = carIn;

            total++;
        }
        else{
            return false;
        }

        return true;

    }
Not sure what other info you need. Just ask.

Thanks
trancecommunity is offline   Reply With Quote