title: setter and getter for vector and list in c++
body: <p>how could i use setter and getter for variable declared with vector and list .</p>
  
  <pre><code>class abc{
  
      private:
         vector&lt;number&gt; test;
         list&lt;numb&gt; test2; 
  
      public:
         void settest(const vector&lt;number&gt; &amp;x){
                 test=x;
  
           }
         vector&lt;number&gt; gettest(){
  
           return test;
         }
  
         void settest2(const list&lt;numb&gt; &amp;y){
                 test2=y;
  
           }
         vector&lt;numb&gt; gettest2(){
  
           return test2;
         }
  
  
  };
   int main(){
     abc object;
  
   }
  </code></pre>
  
  <p>i tried to define set and get method for vector and list like above is it correct?please correct it.
  and how to call set and get function from main??.</p>