| 
Scala example source code file (natives.scala)
 The Scala natives.scala source code
object Test {
  //println("java.library.path=" + System.getProperty("java.library.path"))
  
  val sysWordSize = System.getProperty("sun.arch.data.model", "32")
  val sysType = System.getProperty("os.name")
  
  val libName =
    if (sysType == "Mac OS X")
      "natives"
    else
      "natives-" + sysWordSize
  
  System.loadLibrary(libName)
  @native
  def sayHello(s: String): String = null
  def main(args: Array[String]) {
    val s = sayHello("Scala is great!")
    println("Invocation returned \"" + s + "\"")
  }
}
Other Scala examples (source code examples)Here is a short list of links related to this Scala natives.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.