KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I'm learning Scala and there is a thing that I can't find out about the language: Some time ago I was very comfortable programming in Lisaac, and in Lisaac I could write a class PERSON with a slot list:ARRAY[SELF] , which was equivalent to have list:ARRAY[PERSON] , since SELF is the type of the object where that slot is. But by using SELF , if I write a second class STUDENT that inherits from PERSON , then STUDENT would inherit that slot changing SELF for STUDENT , so STUDENT would have a list of STUDENT instead of PERSON . Can that be done in Scala? I can“t find out anything about that. Thanks!
Tags (comma-separated)
Save Edits
Cancel