Note that there are some explanatory texts on larger screens.

plurals
  1. POHow can I access stored values of a Bean from inside another Class
    primarykey
    data
    text
    <p>How can I implement this functionality?</p> <pre><code>ApplicationConstants.phoneContacts.add( new ContactNumberBean(nameOfContact, contactNumber, contactNumberType)); </code></pre> <p>ApplicationConstants and ContactNumberBean classes </p> <p>ContactNumberBean :</p> <pre><code>package com.example.AddressBook; public class ContactNumberBean { private String nameOfContact; private String contactNumber; private int contactNumberType; public String getnameOfContact() { return nameOfContact; } public String getcontactNumber() { return contactNumber; } public int getcontactNumberType() { return contactNumberType; } public ContactNumberBean(String nameOfContact, String contactNumber,int contactNumberType) { this.nameOfContact=nameOfContact; this.contactNumber=contactNumber; this.contactNumberType=contactNumberType; } } </code></pre> <p>ApplicationConstants :</p> <pre><code>package com.example.AddressBook; import java.util.ArrayList; public class ApplicationConstants { //String[] phoneContacts =new String[10]; //ArrayList&lt;NameValuePair&gt; list = new ArrayList&lt;NameValuePair&gt;(); /*String s1,s2; int i1; ContactNumberBean cb =new ContactNumberBean(str1,str2,i2); static ArrayList&lt;String&gt; phoneContacts = new ArrayList&lt;String&gt;(); phoneContacts.add(s1); phoneContacts.add(s2); phoneContacts.add(i1);*/ how can implemented in this class functionality ................................ **ApplicationConstants.phoneContacts.add(new ContactNumberBean(nameOfContact, contactNumber, contactNumberType));** } </code></pre> <p>please forward some solution thanks in advance ....Narasimha</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload