title: Accessing Variable from different package
body: <p>I want to access the variable in package 1 from package 2.</p>
  
  <p>Class file TestDriver.java from package 1</p>
  
  <pre><code>public class TestDriver {
  private static TestDriver instance = new TestDriver();
  private static int check;
  private static int envt_num;
  public static String envt,port,cpy_key;
  
  public Connection con;
  private ManageDBConnection mdbc;
  
  private static String ENCRYPTION_KEY = "0123456789abcdef";
  
  public void TestDriver(){
      check = 20;
      Properties prop = new Properties();
      String propFileName = "properties/environment.properties";
      try{
      InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream(propFileName);
      System.out.println(inputStream);
      if (inputStream != null) {
          prop.load(inputStream);
          envt = prop.getProperty("envt");
          port = prop.getProperty("port");
          cpy_key = prop.getProperty("cpy_key");
          System.out.println("http://"+envt+"/netprofile/");  
          //Original Login Link
      /*  Constants.driver.get("http://"+prop.getProperty("user").replaceAll("\\s","")+":"+NP_Decrypt.getPassword().replaceAll("\\s","")+"@"+envt+"/netprofile/");
          inputStream.close();*/
          //Added for Local Testing
         String user = prop.getProperty("user");
         String password = prop.getProperty("password");
         Constants.driver.get("http://" + user + ":" + password + "@" + envt + "/test/");
  
  
      //  mdbc = new ManageDBConnection();
          //con = mdbc.CreateConnection();
      } else {
          throw new FileNotFoundException("property file '" + propFileName + "' not found in the classpath");
      }
      }catch(Exception e){
          e.printStackTrace();
      }   
  }
  </code></pre>
  
  <p>}</p>
  
  <p>Class file Constants.java from package 2 </p>
  
  <pre><code> public class Constants 
  {
   static Properties prop = new Properties();
  // propFileName = "properties/environment.properties";
  //TestDriver testdriver = new TestDriver();
   static String envt = TestDriver.envt;
   static String cpy_key = TestDriver.cpy_key;
  
  
   //public static final 
  
   public static final WebDriver driver   = new FirefoxDriver();      
  
   public static final String InventorySummaryURL     ="http://"+envt+"/test/npHome.do?cpyKey="+cpy_key+"&amp;custId=&amp;grpId=0";    
   public static final String HomeSummary             ="http://"+envt+"/test/npIndex.do?cpyKey="+cpy_key+"&amp;custId=&amp;grpId=0";
   public static final String UploadStatus            ="http://"+envt+"/test/downloadModuleStatus.do?cpyKey="+cpy_key+"&amp;custId=&amp;grpId=0" ;
   public static final String ProfileStatus           ="http://"+envt+"/test/myProfileStatus.do?cpyKey="+cpy_key+"&amp;custId=&amp;grpId=0";
  </code></pre>
  
  <p>}</p>
  
  <p>In <code>Constants.java</code> the value returned for <code>envt</code> and <code>cpy_key</code> is zero. I want the value from Package 1. </p>