title: Allow different parameters without overloading method?
body: <p>SOLVED: Thank you everyone for the help, I ended up overriding the method in Person like a couple of you said. My problem was that Character didn't even have doSomething, so what I ended up doing was simply adding doSomething to character and returning nothing. This is because I only had to worry about the a(a person).doSomething(b)(a character) case.</p>
  
  <p>So, I have a method that takes two parameters, Character a and Character b. </p>
  
  <pre><code> public static void giveMessage(Character a, Character b)
  </code></pre>
  
  <p>I want this method to also work if the parameters are Person a (which is a subclass of character), Character b</p>
  
  <pre><code> public static void giveMessage(Person a, Character b)
  </code></pre>
  
  <p>I know I can do this by overloading the method, but it's followed by around 15 lines of code. So if I were to overload it 3 times it would become lengthy. I don't really have a problem with doing this, I'm just wondering if there is an easier way.</p>
  
  <p>More info:</p>
  
  <pre><code>giveMessage(Character a, Character b){
      if(a instanceof Person){
         a.doSomething(b) 
  </code></pre>
  
  <p>doSomething is only found in Person, so it gives me an error that it can't find it in Character.</p>