|
Scala example source code file (S2.scala)
The Scala S2.scala source codepackage a.b package c import a.b.J /** Variations of java-access-pos with us in a nested package. */ /** Declaring "override" all the time. */ class S1 extends J { override private[b] def packageAbstract() = () // fail override protected[b] def protectedAbstract() = () override def publicAbstract() = () override private[b] def packageConcrete() = () // fail override protected[b] def protectedConcrete() = () override def publicConcrete() = () } /** Implementing abstracts. */ class S2 extends J { private[b] def packageAbstract() = () // fail protected[b] def protectedAbstract() = () def publicAbstract() = () } /** Widening access. */ class S3 extends J { protected[b] def packageAbstract() = () // fail protected[b] def protectedAbstract() = () def publicAbstract() = () override protected[b] def packageConcrete() = () // fail override protected[b] def protectedConcrete() = () override def publicConcrete() = () } /** More widening. */ class S4 extends J { private[a] def packageAbstract() = () // fail protected[a] def protectedAbstract() = () def publicAbstract() = () override private[a] def packageConcrete() = () // fail override protected[a] def protectedConcrete() = () override def publicConcrete() = () } /** Yet more widening. */ class S5 extends J { def packageAbstract() = () // fail def protectedAbstract() = () def publicAbstract() = () override def packageConcrete() = () // fail override def protectedConcrete() = () override def publicConcrete() = () } Other Scala examples (source code examples)Here is a short list of links related to this Scala S2.scala source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2024 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.