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

Scala example source code file (nullary.scala)

This example Scala source code file (nullary.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

concrete, concrete, list, list, nullarytest, nullarytest, string, string, t

The Scala nullary.scala source code

abstract class NullaryTest[T, m[s]] {
  def nullary: String = "a"
  val x = nullary

  def nullary2: T 
  val x2 = nullary2

  def nullary3: m[T]
  val x3 = nullary3
}

class Concrete extends NullaryTest[Int, List] {
        def nullary2 = 1
        def nullary3 = List(1,2,3)
}

object test {
        (new Concrete).nullary2
        (new Concrete).nullary3        
}

Other Scala examples (source code examples)

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

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

#1 New Release!

FP Best Seller

 

new blog posts

 

Copyright 1998-2021 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.