// provide read and write access to an objectâs properties
class Cat {
String name;
// getter
String get catName {
return name;
}
// setter
void set catName(String name){
this.name = name;
}
}
// abstract classâa class that canât be instantiated
// This class is declared abstract and thus can't be instantiated.
abstract class AbstractContainer {
// Define constructors, fields, methods...
void updateChildren(); // Abstract method.
}