Scala paste mode

Welcome to Scala series. In this tutorial, you will learn about Scala paste mode. When you want to run multiple lines of code in a single go,I would suggest you to use :paste mode and avoid REPL. The reason is, REPL causes evaluation of the variable to early and might be bit odd to debug each and every line of code. […]

Scala print println printf functions

Welcome to Scala series.In this tutorial you will learn about Scala print println printf functions print To print or display in same line use below print() function. Example Output println println() function prints the inputs in new line. Example Output printf printf() function is useful in formatting strings and it prints consecutive printf calls in same line Example Output Example Output Thanks for reading. Please […]

What is Scala REPL?

Welcome to Scala series. In this tutorial, you will learn about What is Scala REPL and its uses. Scala has provided an interactive command line shell to execute the programs. This is one of the major advantages of Scala. Let us run a sample Scala command to get started. So What is Scala REPL? REPL stands for Read, Evaluate, print and […]

Java LongConsumer Interface with examples

Welcome to Java 8 Series. In this tutorial, you will learn about the Java LongConsumer Interface with examples. LongConsumer is a Functional interface introduced as part of Java 8. It is available in java.util.function package. What is the use of LongConsumer? Consider a case where we need to write a lambda expression which accepts one input of type long and perform an operation on that input […]

Java IntConsumer Interface with examples

Welcome to Java 8 Series. In this tutorial, you will learn about the Java IntConsumer Interface with examples. IntConsumer is a Functional interface introduced as part of Java 8. It is available in java.util.function package. What is the use of IntConsumer? Consider a case where we need to write a lambda expression which accepts one input of type integer and perform an operation on that input […]

Java DoubleConsumer Interface with examples

Welcome to Java 8 Series. In this tutorial, you will learn about the Java DoubleConsumer Interface with examples. DoubleConsumer is a Functional interface introduced as part of Java 8. It is available in java.util.function package. What is the use of DoubleConsumer? Consider a case where we need to write a lambda expression which accepts one input of type double and perform an operation on that input […]

Java Consumer Interface with examples

Welcome to Java 8 Series. In this tutorial, you will learn about the Java Consumer Interface with examples. Consumer is a Functional interface introduced as part of Java 8. It is available in java.util.function package. What is the use of Consumer? Consider a case where we need to write a lambda expression which accepts one input and perform an operation on that input and […]

Java BiFunction Interface with examples

Welcome to Java 8 series.In this tutorial you will learn about Java BiFunction interface with examples. BiFunction is a Functional interface introduced as part of Java 8. It is available in java.util.function package. What is the use of BiFunction Interface? Consider a case where we need to write a lambda expression which accepts two inputs and perform an operation on […]

Java BiConsumer Interface with examples

Welcome to Java 8 Series. In this tutorial, you will learn about Java BiConsumer with examples. BIConsumer is a Functional interface introduced as part of Java 8. It is available in java.util.function package. What is the use of BiConsumer? Consider a case where we need to write a lambda expression which accepts two inputs and perform an operation on two […]

Java 8 Streams

Hello! Welcome to Java 8 series.In this tutorial you will be leaning about Streams in Java. Stream is a new and important feature of Java 8 and it is available in java.util.stream package. What is a Stream? Streams are a sequence of objects from a source. It reads the source and forms a sequence of objects. Stream is a pipeline […]

Java 8 Method references in detail

In this tutorial let us learn about Java 8 method references in detail with a few examples. Overview Lambda expression was introduced in Java 8 to let you write simple and more concise code. It let you create anonymous methods. Kudos to Lambda expression to make developer life easier. BUT … There will be a scenario where lambda expression will […]

Functional Interface in Java 8 with examples

In this tutorial let us learn about Functional interface in Java. A functional interface is an interface which has a single abstract method.This concept has been introduced as part of Java 8. Note: Abstract method is an unimplemented method. A functional interface can have default and static methods. But, it should have only one abstract method. Below is the example of […]

Java 8 | How to do forEach reverse

Checkout how to do forEach reverse in Java 8. There might be a situation where you would like traverse through your collection in reverse order. This can be achieved using traditional for-loop but can it be achieved using Java 8 forEach? The answer is It is not possible to iterate in reverse order using forEach java 8. PERIOD The best […]

Consumer Interface in Java with examples

In this tutorial let us learn about Consumer Interface in Java with examples. Consumer Interface is part of Java 8 and it is available in the java.util.function package. Consumer Interface is a functional interface. It will have only one abstract method and a default method. Interface Description Let us take a close look on accept() method If you notice this […]