Created
July 9, 2014 16:34
-
-
Save nicgrayson/d649ebb6cae064123202 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.util.Random | |
object Module1 { | |
def add(x: Int, y: Int): Int = x + y | |
def main { | |
val employees = | |
Employee("First", 123) :: | |
Employee("Second", 234) :: | |
Employee("Third", 345) :: | |
Employee("Four", 456) :: | |
Employee("Five", 567) :: | |
Nil | |
employees.foreach(employee => print(employee.name +" "+ employee.time.toString)) | |
} | |
} | |
class Employee(name: String, timeEmployed: Int) { | |
def name(): String = name | |
def timeEmployed(): Int = timeEmployed | |
private val age = scala.util.Random.nextInt(100) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment