title: Use a variable returned in a getter method in another class
body: <p>I am still learning but seem to fall at what should be very simple hurdles; my strong points seem to be with the logic of equations but I possess little skill at remembering and implementing functions and correct simple syntax's.</p>
  
  <p>The class that I am implementing the method in is MyClass, the method that I want to define the variable taken from the other class is establishIrEvent. The class that I want to collect the variable from is IREvent, the getter method that returns the variable in this class that I want to collect is getX.</p>
  
  <p>Now for the code:</p>
  
  <p>Getter method from IREvent class:</p>
  
  <pre><code>public int getX() {
      return x;
  }
  </code></pre>
  
  <p>Method that I want to use that variable in to assign, (with my terribly poor attempt) in MyClass:</p>
  
  <pre><code>public void establishIrEvent(IREvent arg0) {
  
      int source = (IREvent)arg0.getX();
  
  }
  </code></pre>
  
  <p>Any advice will be hugely appreciated and fingers crossed this question may aid someone else in a similar pickle! Please ask for any more info as I always seem to miss something or ask a question that annoys an experienced developer somewhat.</p>