title: so in java you can't have duplicate method names with different return and params?
body: <p>Is it possible to have two methods with the same name but different parameters and return types in Java? Seems like it would be a good way to generalize a simple getter and setter..  You can do that with constructors why not with regular methods ? for example</p>
  
  <p>why not be able to do .. </p>
  
  <pre><code>int getVal() {
  
  return int;
  }
  
  boolean getVal() {
  
  return true;
  
  }
  
  setVal(int a) {
  }
  </code></pre>
  
  <p>and </p>
  
  <pre><code>setVal(boolean a) {
  
  }
  </code></pre>