This page is no longer maintained — Please continue to the home page at www.scala-lang.org

Abstract superclass and constructor parameters.

1 reply
edmondo1984
Joined: 2011-09-14,
User offline. Last seen 28 weeks 3 days ago.
Dear All,
I have a question about visibility of properties in scala.

If I understood right, a constructor with a val parameter produces a final public property. I have a case where I created a superclass of an abstract class, and while in the superclass I can access that property, I can't access it in other code using an object of superclass type.

Can you please help me?

Thank you very much

Edmondo
Alec Zorab
Joined: 2010-05-18,
User offline. Last seen 42 years 45 weeks ago.
Re: Abstract superclass and constructor parameters.

These things are so much easier to help with when there's a code sample...

On Wed, Sep 21, 2011 at 9:32 AM, Edmondo Porcu wrote:
> Dear All,
> I have a question about visibility of properties in scala.
>
> If I understood right, a constructor with a val parameter produces a final
> public property. I have a case where I created a superclass of an abstract
> class, and while in the superclass I can access that property, I can't
> access it in other code using an object of superclass type.
>
> Can you please help me?
>
> Thank you very much
>
> Edmondo
>

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland