jeudi 6 octobre 2022

Can someone tell me if my answer to this Past Paper Question is correct please?

I am working through a past paper as practice and came across the following question:

Consider the ActorList class below

class ActorList
{
public:
  ~ActorList();
  static ActorList* getActorList();
  bool addActor(Actor *a);
  int size() const;
  Actor* getActor(int i);
private:
   ActorList();
   static ActorList* actorList;
   QList<Actor*> list;
}

No other information is given.

Am I correct in saying that the design pattern used here is the Singleton design pattern?

Aucun commentaire:

Enregistrer un commentaire