title: passing object of class to another class
body: <p>I have two classes. <code>Class A</code> and <code>Class B</code>.</p>
  
  <p>I have a function in <code>Class A</code> that i would like to use in <code>class B</code>. I was thinking about passing a reference of <code>Class A</code> to the constructor of <code>Class B</code> and then call the function after that.</p>
  
  <p>Would that work? Can someone show me an example?</p>
  
  <p>Thanks in advance!</p>