• Menu
  • Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

JavaBeat

Java Tutorial Blog

  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)
  • Java
    • Java 7
    • Java 8
    • Java EE
    • Servlets
  • Spring Framework
    • Spring Tutorials
    • Spring 4 Tutorials
    • Spring Boot
  • JSF Tutorials
  • Most Popular
    • Binary Search Tree Traversal
    • Spring Batch Tutorial
    • AngularJS + Spring MVC
    • Spring Data JPA Tutorial
    • Packaging and Deploying Node.js
  • About Us
    • Join Us (JBC)

Scala

Playing with reduceLeft, reduceRight, foldLeft, foldRight API in Scala

July 18, 2012 //  by Mohamed Sanaulla

In our previous post we saw in detail about the foreach. map, flatMap and collect methods in the Iterable trait. In this post we will look into detail about reduceLeft, reduceRight, foldLeft, foldRight methods of the Iterable trait. These methods are almost similar in the way the operate on the collection so it should be …

Category: ScalaTag: scala

Playing with Collections API in Scala

July 16, 2012 //  by Mohamed Sanaulla

While I was going through the Scala collections API, I found the mere reading through the method and its functionality is not going to help. And I also realised that it will be useful if I can document them. And with that idea, I will try to document the APIs which I have tried. Please …

Category: ScalaTag: scala

Functions as First Class Citizens in Scala

July 11, 2012 //  by Mohamed Sanaulla

In Java (Java 7 and before) we can store an object reference in a variable or some primitive value in which case Classes and Primitive types are the first class citizens there, but in Scala we can assign method/function definitions to variables, we can pass around function definitions to other functions and we can even …

Category: ScalaTag: scala

Using Apply and Unapply Methods in Scala

July 7, 2012 //  by Mohamed Sanaulla

Before we proceed to learn about Apply and Unapply methods, its good to know what a companion object is. A companion object in Scala for some class say Fraction is defined as: One can provide apply(args) and unapply(args) methods in the companion objects which can be used implemented to some special operations in Scala. Suppose …

Category: ScalaTag: scala

Traits in Scala- Advanced concepts

July 6, 2012 //  by Mohamed Sanaulla

In our previous article we covered very basic concepts on traits. In this article we will expand on our initial work and explore the inherent power of traits. As we said here just like the Interfaces traits can have abstract methods. Also traits can extend other traits just like Interfaces can extend other interfaces. also …

Category: ScalaTag: scala, scala traits

Traits in Scala

July 5, 2012 //  by Mohamed Sanaulla

Java doesn’t allow multiple inheritance for the fear of Deadly Diamond of Death. And to circumvent this Java introduced interfaces where in a class can extend only one other class, but implement multiple interfaces. These interfaces don’t contain any implementations. (This is going to change with Defender Methods in Java 8). Lot of other languages …

Category: ScalaTag: scala

Inheritance and Overriding in Scala

July 4, 2012 //  by Mohamed Sanaulla

Inheritance in Scala is quite similar to the way it is in Java. The overriding aspects are a bit more detailed because in Scala there are not just methods to override but also vals, vars. There are a few restrictions added in Scala like: Overriding classes must use the “override” modifier. In Java one can …

Category: ScalaTag: scala

Primary and Auxiliary Constructors in Scala

June 29, 2012 //  by Mohamed Sanaulla

Introduction to Scala Constructor Constructors in Scala are a bit different than in Java. Scala has 2 types of constructors: Primary Constructor Auxiliary Constructor also read: Primary and Auxiliary Constructors in Scala Traits in Scala Java HelloWorld vs Scala HelloWorld Primary Constructor In Java we have a no-args default constructor which is provided for every class …

Category: ScalaTag: scala

  • Go to page 1
  • Go to page 2
  • Go to Next Page »

Primary Sidebar

Follow Us

  • Facebook
  • Pinterest

FEATURED TUTORIALS

How to Use Optional.ofNullable() Method in Java

What is new in Java 6.0 Collections API?

The Java 6.0 Compiler API

Introductiion to Jakarta Struts

What’s new in Struts 2.0? – Struts 2.0 Framework

JavaBeat

Copyright © by JavaBeat · All rights reserved
Privacy Policy | Contact