Can I make `xPath` and `contextString` private?
# announcements
o
Can I make
xPath
and
contextString
private?
d
No, you cannot lower the visibility of inherited / overridden members. That would violate the liskov substitution principle
r
Even if you were able to mark it as private in
ExistingLinkMatch
, you could just cast it to
Match
and access it.
o
I see, thanks
a
If those variables are defined as val in the Match() interface then you can modify and make them private and can change immutability to var as well.