• Badrinath Murali
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies
Hi All,
I am trying to create the below class/method with a constructor to learn Apex:
public class Employee {
    public string Name;
    public decimal Sal;
    public decimal Exp;
    public employee(string name,decimal sal,decimal Exp){
        Name = name;
        Sal = Sal;
       Exp = Exp;
      public void display(){   
       sal = sal*exp;
            system.debug('Salary='+Sal);
        }
    }
}
I am getting multiple code complie errors:
unexpected token: 'public'
unexpected syntax: 'missing SEMICOLON at 'display''
Variable does not exist: void
Method does not exist or incorrect signature: void display() from the type Employee

Can somebody please help understand my mistakes in the code.
Many Thanks
Badri
Hi All,
I am trying to create the below class/method with a constructor to learn Apex:
public class Employee {
    public string Name;
    public decimal Sal;
    public decimal Exp;
    public employee(string name,decimal sal,decimal Exp){
        Name = name;
        Sal = Sal;
       Exp = Exp;
      public void display(){   
       sal = sal*exp;
            system.debug('Salary='+Sal);
        }
    }
}
I am getting multiple code complie errors:
unexpected token: 'public'
unexpected syntax: 'missing SEMICOLON at 'display''
Variable does not exist: void
Method does not exist or incorrect signature: void display() from the type Employee

Can somebody please help understand my mistakes in the code.
Many Thanks
Badri
I would like to speak to any Salesforce Marketing Cloud specialists interested in joining a progressive Salesforce partner in Australia.
Ideally you will be a Certified Marketing Cloud Email Specialist and / or a Certified Marketing Cloud Consultant but if you have the experience and confidence in Salesforce Marketing Cloud you will be put through the certification process.  Australian 457 visa Sponsorship is available for overseas candidates who have the Marketing Cloud experience.
Please reply or contact me on j.liley@frankgroup.com for a confidential conversation.