Hi. Im trying this java program that's suppose to register the "staff"'s "car" and there's this boolean method that I don't know how to solve.
There are 3 classes: Tester, Staff and Car.

the boolean part is suppose to check if the staff has 1 or 2 cars registered and if it is null then assign car object to staff's Car.

public boolean registerCar(Car car, String stickerNum) {
    if(car.getOwnerId() != null){
        //not sure how to continue

    return false;

if anyone is kind enough to help me out, much appreciated. thanks

Re: Java Program : Objects and Classes 80 80

You have provided too few details for someone unfamiliar with the project to try to help you. I presume this is an assignment for a Java programming class and you've been given an assignment specification and/or skeleton code? I could guess what the functions are supposed to do and what the class data members are, etc., but it would only be a guess.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.19 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.