title: Java Generics - quick question on Greater Than Method with Objects
body: <p>I have an assignment in my Java class, we are learning Generics, I have looked in my notes, my lessons, and even on the internet and I still cant figure out what this last assignment question is asking me to do, which is:</p>
  <p><strong>Write a generic “greater-than” function that takes two objects as arguments, each of which has a “value” method which returns an integer and returns the argument whose “value” method returns the larger integer. Your generic function should constrain its type argument so that types without a “value” method cannot be  used.</strong></p>
  <p>Is there a reason why &quot;value&quot; in quotation marks and how can a method constrain its type argument so that types without a &quot;value&quot; method cant be used. I'm mainly asking for clarification or maybe a little example.
  Am I creating a Value class and then doing something like this:</p>
  <pre><code>public static &lt;T&gt; int greaterThan(Value obj1, Value obj2){ // Value will have the &quot;value&quot; method?
      // do I compare the objects here or in the Value class?
  }
  </code></pre>