Getters Setters
// 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;
}
}
Comments