title: How to set values to a class variables without using setters
body: <p>I want to insert a value to an <code>Object</code> variable without using the setters. How can if be possible.</p>
  
  <p>This is an example</p>
  
  <pre><code>Class X{
  String variableName;
  // getters and setters
  }
  </code></pre>
  
  <p>Now i have a function which contains the <code>variable name</code>, the <code>value to be set</code> and an <code>Object of the Class X</code>. </p>
  
  <p>I am trying to use a generic method to set the value to the Object(objectOfClass) with the value i have passed(<code>valueToBeSet</code>) in the corresponding variable(<code>variableName</code>).</p>
  
  <pre><code>Object functionName(String variableName, Object valueToBeSet, Object objectOfClass){
  
      //I want to do the exact same thing as it does when setting the value using the below statement
      //objectOfClass.setX(valueToBeSet);
  
  return objectOfClass;
  }
  </code></pre>