Classes and OOP
- Q93: How do I define a class in EK9?
- Q94: How do I implement a constructor in EK9?
- Q95: How do I control field visibility in EK9?
- Q96: How do operators work in EK9?
- Q97: What is the difference between classes and records in EK9?
- Q98: How do record operators work in EK9?
- Q99: How do I create an enumeration in EK9?
- Q100: How do EK9 enumerations differ from Java enums?
- Q101: Why are types closed by default in EK9?
- Q102: How do I make a class extensible with 'as open'?
- Q103: What are abstract classes and methods in EK9?
- Q104: Why does EK9 require explicit constructors for uninitialised properties?
- Q105: How does method dispatch work in EK9?
- Q106: What are traits and how do I use them in EK9?
- Q107: Can a class implement multiple traits in EK9?
- Q108: How do I implement a trait for my class?
- Q109: How do I use composition instead of inheritance in EK9?
- Q110: What is the difference between a trait and an abstract class?
- Q111: What are components in EK9?
- Q112: How do services work in EK9 for REST and HTTP?
- Q113: How does the text construct work for internationalization?
- Q114: How do aspects work with components for AOP?
- Q115: How do dynamic classes work in EK9?
- Q116: What does 'default operator' generate?
- Q117: How do I create a singleton in EK9?
- Q118: How do I implement the builder pattern in EK9?
- Q119: What EK9 constructs are available and when should I use each?
- Q768: Why can't an abstract method have a body in EK9?
- Q769: Why does EK9 require an explicit constructor when properties are uninitialized?
- Q770: Why can't I use 'by' delegation inside a trait?
- Q771: Why must a dispatcher method have a body in EK9?
- Q772: Why does EK9 reject circular type hierarchies?
- Q773: Why must a method either have a body or be marked abstract?
- Q774: Why can't a constructor be abstract in EK9?
- Q775: Why can't a constructor use the override keyword in EK9?
- Q776: Why can't a default constructor have parameters in EK9?
- Q778: Why can't I change the access modifier when overriding a method?
- Q779: Why must certain operators return a value in EK9?
- Q781: Why does EK9 reject calls with the wrong number of arguments?
- Q783: Why does EK9 reject override when there is no parent method?
- Q784: Why can't I extend a class in EK9?
- Q787: Why can't I use 'this' in a function in EK9?
- Q834: Why can't I use 'default operator <=>' on a record with a function delegate field?
- Q835: Why can't I provide a signature or body when using 'default operator' in EK9?
- Q838: Why can't I use 'with application of' on a regular class method in EK9?
- Q874: How do I create a class with a constructor and methods in EK9?
- Q876: How do I define a record with fields in EK9?
- Q878: How does EK9 handle return values without a return statement?
- Q882: Why can't I access class fields from outside the class in EK9?
- Q900: What is the difference between record and class field visibility in EK9?
- Q904: Why can't I extend a class in EK9?
- Q955: Why does EK9 report E06260 when defining package properties?
- Q976: Are record fields public or private in EK9?
- Q1060: Are record fields public or private in EK9?
- Q1064: I have several functions that all take the same 4 arguments. How do I clean this up in EK9?
- Q1175: Define a Product record with name, price, and a constructor.
- Q1180: Define an abstract Shape class with an area method, and a concrete Circle subclass.
- Q1198: Calculate an end date from a start date and a duration gap on a Project class.
- Q1204: Define an Employee record with name, hire date, and department, then sort employees by hire date.
- Q1250: Show me how to make a Repository class extensible so that InMemoryRepository can inherit from it without triggering E05030.
- Q1251: Create me a Database abstract class that PostgresDatabase can extend, showing that 'as abstract' makes the class implicitly open to extension.
- Q1282: What does EK9 error E04050 mean when I declare a class field and how do I fix it?
- Q1283: When should I use 'name as Type: value' instead of 'name <- value' for a class field to avoid E04050?
- Q1297: Can records extend other records in EK9?
- Q1317: Why can't I mark a method 'protected' in a closed class?