You need to sign in to do that
Don't have an account?
Nagamanohar Kavuri 9
Can some one help to create Class->Two Private Variables->Accept Parameter from Constructor to set values->New Method to show details-->Call instance of class in Dev Console
I wrote the below code,but througing the error as Constructor not defined and method doesnt exist
//Class
public class ConnectionDetails {
Private String ConnectionCode;
Private Integer Price;
//Constructor
public ConnectionDetails(String ConnectionCode,Integer Price)
{
this.ConnectionCode='ConnectionCode';
this.Price=Price;
}
//Method
Public static void showDetails(String ConnectionCode,Integer Price)
{
ConnectionDetails cd =new ConnectionDetails();
cd.showDetails('ConnectionCode','Price');
}
}
//Class
public class ConnectionDetails {
Private String ConnectionCode;
Private Integer Price;
//Constructor
public ConnectionDetails(String ConnectionCode,Integer Price)
{
this.ConnectionCode='ConnectionCode';
this.Price=Price;
}
//Method
Public static void showDetails(String ConnectionCode,Integer Price)
{
ConnectionDetails cd =new ConnectionDetails();
cd.showDetails('ConnectionCode','Price');
}
}
Below is the modified code,
Thanks,
Govindaraj.S
All Answers
Below is the modified code,
Thanks,
Govindaraj.S