Over a million developers have joined DZone.

Scala – First Experience

· Java Zone

Learn more about the advantages of moving from a monolithic to microservices architecture.  Brought to you in partnership with IBM.

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.

From Idea to Application gives you the architecture to quickly build, manage and run a range of applications (web, mobile, big data, new smart devices, etc.) on an open-standard, cloud-based platform. See why developers are using IBM Bluemix. Brought to you in partnership with IBM.


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

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

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

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

{{ parent.tldr }}

{{ parent.urlSource.name }}