0

Big encapsulation-style languages, such as Java, Kotlin, or C#, have a distinction between classes and types. S4, being a generic-function style OOP system, is fundamentally different. But does it still have a class/type distinction of any kind?

Note this question is very similar to Does R's S3 OOP system have a distinction between classes and types?. It may have a similar, perhaps identical, answer. If there is a difference, explaining it would be helpful.

J. Mini
  • 1,868
  • 1
  • 9
  • 38
  • What do you think the distinction between classes and types is in Java, Kotlin and C#? Are you simply referring to the distinction between primitive and user-defined types? Because that has nothing to do with “encapsulation-style languages”, whatever that may actually be. – Konrad Rudolph Aug 16 '22 at 14:05
  • @KonradRudolph For example, I often hear it said that "a type is a contract; a class is its implementation". – J. Mini Aug 16 '22 at 19:36
  • That isn’t really related to encapsulation, and it’s a pretty vague and generic statement that can effectively applied anywhere. – Konrad Rudolph Aug 16 '22 at 20:09

0 Answers0