I am new to Salesforce Development/Apex and am running practice exercises. When I run this code thru the 'Anonymous Apex' window, it throws an error reading: "Unexpected token 'Public'. " Please help me understand what my problem is.
I have created the following Employee Object that should print:
//Name: Lucious; Designation:CEO //Name: Johanna Designation: COO
Here is my Code:
public class Employee
{
public String name;
public designation;
public void show()
{
System.debug('Name: ' + name);
System.debug('Designation: ' + designation);
}
}
Employee e1 = new Employee();
Employee e2 = new Employee();
e1.name = 'Lucious';
e1.designation = 'CEO';
e2.name = 'Johanna';
e2.designation = 'COO';
e1.show();
e2.show();