Programming, Functional Programming, Scala, Tutorial, Venkat Subramaniam.
class StockPrice(ticker : String, price : Double) { ​ def print = ​ println("Top stock is " + ticker + " at price $" + price) ​ } Given a ticker symbol, we want to get the latest stock price for that symbol. Thankfully, Yahoo makes this easy. ​ def getPrice(ticker : String) = { ​ val url =