title: How to create a custom arraylist with custom methods
body: <p>I was asked this question in an interview.</p>
  
  <p>How do we create a custom <code>ArrayList</code> with all the methods implemented in the <code>ArrayList</code> except for the <code>remove</code>, <code>removeAll()</code> method?</p>
  
  <p>So, my <code>ArrayList</code> implementation must not have these two methods.</p>
  
  <p>One solution I got was to extend my class to the <code>ArrayList</code> class and implement all the methods except the <code>remove()</code> and <code>removeAll()</code> method.</p>
  
  <p>I am not sure if this is the right way.</p>