Scala

Scala Primary Constructor In-Depth

In this post, we are going to discuss about Scala Primary Constructor in depth with real-time scenario examples. Post Brief TOC Introduction Primary Constructor in Scala Scala val and var in-brief Scala Primary Constructor With….

Scala Type Bounds: Upper Bounds, Lower Bounds and View Bounds

In my previous post, I have discussed about Scala Variance in detail. In this post, we are going to discuss about “Scala Type Bounds”. What is Type Bound in Scala? In Scala, Type Bounds are….

Scala Variances: Covariant, Invariant and Contravariant

In this post, we are going to discuss about Scala Variance and it’s use cases. What is Variance? Variance defines Inheritance relationships of Parameterized Types. Variance is all about Sub-Typing. Please go through the following….

VarArgs Functions and @varargs Annotation in Scala

In this post, we are going to discuss about Functions with Var-Args (Variable Number Of Arguments) concept in Scala. Introduction Var-Args Functions(Methods) means taking Variable Number of Arguments. As a Java Developer, We have already….

Named Parameters and Default Parameter Values In Scala

In this post, we are going to discuss the following two important concepts in Scala about Function(Method) or Constructor Parameters Named Parameters Default Parameter Values Introduction Let’s assume that we are going to develop a….

Scala Variances, Upper type Bounds and Lower type bounds

Variance refers as how subtyping between complex types relates to subtypes of their components. Scala supports variances annotations of type parameters of a generic class. The type of variance annotations supported in Scala are; Types….

Scala Currying and Automatic Type-Dependent Closure Construction

Scala Currying is the process of transforming a function that takes multiple arguments into a single argument. Consider an example of multiplying two numbers .Open the scala REPL shell and create the multiply method as….

Scala Polymorphic Methods and Explicitly Typed References

The methods in scala can be parametrized with both value and types. Value parameters are enclosed within a pair of parenthesis whereas type parameters within a pair of brackets. For example; polymorphic.scala object polymorphic {….

Scala Sequence Comprehensions, Generic Classes and Inner Class Example

A sequence comprehension statement consists of a generator part which generates a list of values from the specified range of inputs and a statement which operates on these generated elements which is then stored in….

Scala Annotations Example

Scala Annotations are metadata or extra information added to the program source code. Like comments, annotations can be attached to a variable, method, expression or any other program element. Annotations are allowed on any kind….

close
Generic selectors
Exact matches only
Search in title
Search in content
Search in posts
Search in pages