fork download
  1. public class Car{
  2. String carname;
  3. String model;
  4. String owner;
  5.  
  6. Integer year;
  7.  
  8.  
  9. public void gets(String carname,String model, String owner, Integer year)
  10. {
  11. this.carname=carname;
  12. this.model=model;
  13. this.owner=owner;
  14. this.year=year;
  15. }
  16.  
  17. public void show()
  18. {
  19. System.debug("Car name : ",this.carname);
  20. System.debug("Model name : ",this.model);
  21. System.debug("Owner name : ",this.owner);
  22. System.debug("Year name : ",this.year);
  23. }
  24. }
  25.  
  26.  
  27. Car c1=new Car();
  28. c1.gets("Ford Ecosport","Disel","Manan",2024);
  29. c1.show();
Success #stdin #stdout #stderr 0.02s 8936KB
stdin
Standard input is empty
stdout
Object: UndefinedObject error: did not understand #Car
MessageNotUnderstood(Exception)>>signal (ExcHandling.st:254)
UndefinedObject class(Object)>>doesNotUnderstand: #Car (SysExcept.st:1448)
UndefinedObject>>executeStatements (prog:1)
stderr
./prog:3: parse error, expected '}'