title: How to call a variable from one java class in a different class
body: <p>I ran into an issue, where I need to call a variable created in one java class in another java class.</p>
  
  <p>Course.java</p>
  
  <pre><code>public class Course {
     public String courseName;
  </code></pre>
  
  <p>SecondCourse.java</p>
  
  <pre><code>    public class SecondCourse {
          Course courseName;
  
  @Before
      public void setUp() throws Exception {
          courseName = new Course();
  </code></pre>
  
  <p>Eventhough, I have set up it like this, the varible call doesn't work in SecondCourse.java Class. Have I missed something?
  Can you help me?</p>
  
  <p>I'm trying to call</p>
  
  <pre><code>driver.findElement(By.xpath("//div/input")).sendKeys(courseName); 
  </code></pre>
  
  <p>in the SecondCourse.java class.
  But gives me the error
   sendKeys(java.lang.CharSequence...) in org.openqa.selenium.WebElement cannot be applied</p>