You need to sign in to do that
Don't have an account?

How to call data members from one class to another class?
Hi,
I have two classes Class1(parent) & Class2 (child)
Public parnent{
public string a;
public string b;
public string c;
}//end of class 1
Public child{
public string x;
public string y;
public string z;
}//end of class 2
here I want to access a,b,c into child class what is the syntax to call from child to parent class
I tried below syntax it is throwing an error
Public class child extends parent
{
}
Thanks in advance
I have two classes Class1(parent) & Class2 (child)
Public parnent{
public string a;
public string b;
public string c;
}//end of class 1
Public child{
public string x;
public string y;
public string z;
}//end of class 2
here I want to access a,b,c into child class what is the syntax to call from child to parent class
I tried below syntax it is throwing an error
Public class child extends parent
{
}
Thanks in advance
refer this link
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_example.htm
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_extending.htm