title: Call variable from another class using java
body: <p>i have a code to test a web application using webdriver, the app contains more than 100 elements.
  My testing code works fine but if one day if one of the element is modified i will have to change in all my code everywhere is use this element.
  So i want to put all element as String in one class and then call one of the element from another class.</p>
  
  <p>How can do this?
  For example:
  my test code for gmail inbox:</p>
  
  <pre><code>public class ShowInbox {
  
      public ShowInbox(WebDriver driver) {
  
  
          driver.get(driver.getCurrentUrl());
          Utility.wait(3);
          String Inbox = "J-Ke n0";
          String MsgSuivis = "J-Ke n0 aBU";
  
          try {
          driver.findElement(By.className(Inbox)).isDisplayed();
          System.out.println("Boîte de réception exists");
          driver.findElement(By.className(Inbox)).click();
          } 
  catch (NoSuchElementException e) {
  System.out.println("Boite de réception is not displayed");
          } finally {
              System.out.println("continue");
          }
  
          try {
  
              driver.findElement(By.className(MsgSuivis)).isDisplayed();
              System.out.println("Messages suivis exists");
              driver.findElement(By.className(MsgSuivis)).click();
          } catch (NoSuchElementException e) {
              System.out.println("Messages suivis is not displayed");
          } finally {
              System.out.println("continue");
          }
          driver.quit();
      }
  }
  </code></pre>
  
  <p>This code is working well when it runs.
  Now i want to create a class which will contain only
  String Inbox = "J-Ke n0";
  String MsgSuivis = "J-Ke n0 aBU";
  And then in another i want to call for example only Inbox and then the code to test the inbox.</p>
  
  <p>Any help please, thank you</p>