Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Scala – First Experience

DZone's Guide to

Scala – First Experience

· Java Zone ·
Free Resource

Verify, standardize, and correct the Big 4 + more– name, email, phone and global addresses – try our Data Quality APIs now at Melissa Developer Portal!

Using Eclipse IDE and the details are as follows

Scala IDE build of Eclipse SDK
Build id: 3.0.4-2.11-20140723-2253-Typesafe

Scala Library – 2.11.2

A phenomenal change in the mindset.

The first learning is

  • def defines a method
  • val defines a fixed value (cannot be modified)
  • var defines a variable (can be modified)

Took sometime to understand.

How to read a file and move the contents to a list? (“\n” being the line separator)

val fileContentsList= io.Source.fromFile(“h:/SampleTripFile.txt”).getLines.toList

main method is also there

def main(args: Array[String]) {

Used Casbah (Scala toolkit for MongoDB).

Yes, good learning and enjoying the constructs and the simplicity.

Developers! Quickly and easily gain access to the tools and information you need! Explore, test and combine our data quality APIs at Melissa Developer Portal – home to tools that save time and boost revenue. 

Topics:

Published at DZone with permission of

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}