fork download
  1. public class Emp { // Changed the class name to 'Emp' if that’s the intended name
  2. String Name;
  3. String EMPID;
  4. String salary;
  5. String experince;
  6.  
  7. public static void display() {
  8. // Creating an instance of the Emp class
  9. Emp emp = new Emp();
  10.  
  11. // Initializing instance variables
  12. emp.Name = 'Vamsi';
  13. emp.EMPID = '102586';
  14. emp.salary = '10,222';
  15. emp.experince = '2';
  16.  
  17. // Using System.debug to print values in the Apex logs
  18. System.debug(emp.Name);
  19. System.debug(emp.EMPID);
  20. System.debug(emp.salary);
  21. System.debug(emp.experince);
  22. }
  23. }
  24.  
Success #stdin #stdout #stderr 0.01s 8976KB
stdin
Standard input is empty
stdout
Object: UndefinedObject error: did not understand #Emp
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject class(Object)>>doesNotUnderstand: #Emp (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
stderr
./prog:1: parse error, expected '}'
./prog:1: Invalid character 0xe2
./prog:1: Invalid character 0x80
./prog:1: Invalid character 0x99