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

The single app analytics solutions to take your web and mobile apps to the next level.  Try today!  Brought to you in partnership with CA Technologies

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.

CA App Experience Analytics, a whole new level of visibility. Learn more. Brought to you in partnership with CA Technologies.

Topics:

Published at DZone with permission of Jagannathan Asokan, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

THE DZONE NEWSLETTER

Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

X

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

{{ parent.tldr }}

{{ parent.urlSource.name }}