Java 8 Stream API

Why Streams If you are looping collection to run specific operation, streams is the solution Process computations on large collections with less code, in parallel and efficiently Streams Stream is like pipeline of sequence of elements from a source (e.g. collections)...

Lambda Expressions in Java 8

Functional Interface A functional interface is any interface that contains only one abstract method It may contain extra default or static methods  Lambda Expressions Treat functionality as method argument It adds Functional behaviour to Java It is basically an...

Generics in Java

Generics Introduced in JDK 1.5 Provide compile-time type safety Enable developer to declare generic class or method Some problems solved by Generics Problem 1 – No compile-time safety List list = new ArrayList(); list.add(“oneness”); Integer i =...

Java Object Serialization

Java Object Serialization Introduction Mechanism where an object can be converted to a sequence of bytes that includes the object’s data as well as information about the object’s type and the types of data stored in the object Object can be serialized and...
Java Message Service (JMS)

Java Message Service (JMS)

Java Message Service (JMS)   Message Oriented Middleware API for sending messages between clients & allows the communication between different components of a distributed application to be loosely coupled, reliable, and asynchronous Java Message Service...

What is the difference between an interface and abstract class?

What is the difference between an interface and abstract class? Similarities You cannot instantiate them They may contain a mix of methods declared with or without an implementation Differences Interface abstract class All fields are automatically public, static, and...