title: How to keep someone from inputting a certain value on a java method?
body: <p>I have this method:</p>
  
  <pre><code>public static int getSlotFromRow(int row, int slot)
  </code></pre>
  
  <p>Imagine this as getting the slot from a row in a certain data table.</p>
  
  <p>Each row has 9 slots and the maximum rows is 6. I want this method to return an integer that tells me the slot (for example, if i want the 3rd slot on the 4th row, the method would return 30). </p>
  
  <p>But how do I keep someone from inputting an integer bigger than 6 on the row variable and an integer bigger than 9 on the slot variable when they are using the method?</p>