alvinalexander.com | career | drupal | java | mac | mysql | perl | scala | uml | unix  

Scala example source code file (S1.scala)

This example Scala source code file (S1.scala) is included in the DevDaily.com "Java Source Code Warehouse" project. The intent of this project is to help you "Learn Java by Example" TM.

Java - Scala tags/keywords

j, j, s1, s1, s2, s3, s4, s4, s5, s6, s6, s7

The Scala S1.scala source code

package a.b

/** Declaring "override" all the time.
 */
class S1 extends J {
  override private[b] def packageAbstract() = ()
  override protected[b] def protectedAbstract() = ()
  override def publicAbstract() = ()
  
  override private[b] def packageConcrete() = ()
  override protected[b] def protectedConcrete() = ()
  override def publicConcrete() = ()
}

/** Implementing abstracts.
 */
class S2 extends J {
  private[b] def packageAbstract() = ()
  protected[b] def protectedAbstract() = ()
  def publicAbstract() = ()
}

/** Widening access.
 */
class S3 extends J {
  protected[b] def packageAbstract() = ()
  protected[b] def protectedAbstract() = ()
  def publicAbstract() = ()
  
  override protected[b] def packageConcrete() = ()
  override protected[b] def protectedConcrete() = ()
  override def publicConcrete() = ()
}
/** More widening.
 */
class S4 extends J {
  private[a] def packageAbstract() = ()
  protected[a] def protectedAbstract() = ()
  def publicAbstract() = ()
  
  override private[a] def packageConcrete() = ()
  override protected[a] def protectedConcrete() = ()
  override def publicConcrete() = ()
}
/** Yet more widening.
 */
class S5 extends J {
  def packageAbstract() = ()
  def protectedAbstract() = ()
  def publicAbstract() = ()
  
  override def packageConcrete() = ()
  override def protectedConcrete() = ()
  override def publicConcrete() = ()
}
/** Constructors.
 */
class S6 extends J(1) {  
  def packageAbstract() = ()
  def protectedAbstract() = ()
  def publicAbstract() = ()
}
class S7 extends J(1, 2) {
  def packageAbstract() = ()
  def protectedAbstract() = ()
  def publicAbstract() = ()
}

Other Scala examples (source code examples)

Here is a short list of links related to this Scala S1.scala source code file:

... this post is sponsored by my books ...

#1 New Release!

FP Best Seller

 

new blog posts

 

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.