8 ms·
Maybe. It depends what the definition of "object-oriented" is, which depends what the definition of "object" is. Neither of which has any semblance of agreement
by tubthumper8 3y ago
Maybe. It depends what the definition of "object-oriented" is, which depends what the definition of "object" is. Neither of which has any semblance of agreement among programmers.
Many people would define an object as something that has externally visible behavior and internally hidden _data_. Objects could never be compared to each other for equality, because one could not access the internal data, only its public behavior. However, Java records can be compared for equality which objects would not.
Java records also cannot be extended from. Inheritance is the only uniquely OOP feature, which doesn't apply here either.
So I'm not sure that Java records are an object-oriented construct. First, the precise definition of OO should be established, and then we'll see