Changes for page WebObjects with Scala
Last modified by Ravi Mendis on 2011/05/10 02:10
From version 355.1
edited by Ravi Mendis
on 2009/10/13 23:34
on 2009/10/13 23:34
Change comment:
There is no comment for this version
To version 354.1
edited by Ravi Mendis
on 2009/10/13 21:35
on 2009/10/13 21:35
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -47,10 +47,8 @@ 47 47 Scala doesn't have static variables or methods. However, a class can have a //Companion Object// that will allow you to achieve something equivalent to static variables. 48 48 One of the advantages of this approach is that it is **thread-safe**, so you don't have to worry about synchronizing access to these fields in a concurrent application. 49 49 50 - The followingis an example of the use of a //Companion Object// for Talent in Scala instead of static fields inJava.50 +In Java: 51 51 52 -Java: 53 - 54 54 {{code}} 55 55 56 56 public class _Talent extends EOGenericRecord { ... ... @@ -58,7 +58,7 @@ 58 58 59 59 {{/code}} 60 60 61 -Scala: 59 +In Scala: 62 62 63 63 {{code}} 64 64