How can I implement this functionality?
ApplicationConstants.phoneContacts.add(
new ContactNumberBean(nameOfContact,
contactNumber, contactNumberType))
hi to access been values in another class create a common class named as Constants.java in that declare and initialize been object like below:
public class Constants{
public static Bean userBeen=new Bean();
}
been class:
public class Been {
private string countryName;
public void setCountry(String s) {
this.countryName=s;
}
public String getCountry() {
return countryName;
}
}
set values:
public class A{
String s="India";
Constants.userBeen.setCountry(s);
}
}
get values:
public class B{
String s=Constants.userBeen.getCountry();
}
}
this will work fine.