Upper Bound

Scala: Type Bounds

As we have already discussed in my last blog¬†about the Type Parameterization concepts like Generics, Generic classes, and Variance. So to follow up, in this blog we’ll be discussing type bounds. Type Bounds: How can we create type parameter restrictions? To create them we make use of Scala type bounds. In Scala, Type Bounds are restrictions on Type Parameters or Type Variable. By using Type Continue Reading

Back2Basics: Demystifying Variance

In this blog, we will explore types of variances in Scala. In-variance Co-variance Contra-variance First, let’s talk about Types in Scala. scala> import java.util.ArrayList scala> var ref1: Any = “Hi” ref1: Any = Hi scala> var ref2: String = “Hi” ref2: String = Hi scala> ref1 = ref2 ref1: Any = Hi In the above example, ref1 is of type Any and ref2 is of Continue Reading

Knoldus Pune Careers - Hiring Freshers

Get a head start on your career at Knoldus. Join us!