Functional Interface in Java

In Java, functional interfaces are those interfaces who has exactly one abstract method.  @FunctionalInterface is not a mandatory annotation to be used to make any interface a Functional Interface. Its just an informative annotation type used to indicate that an interface type declaration is intended to be a functional interface. Since default methods have an implementation, they are not abstract. Note: – If an interface declares any method of … Continue reading Functional Interface in Java

Factory Design Pattern

Factory design pattern belong to the Creational design pattern category which explain how the objects are created. Factory Design Pattern comes with different flavors and we use the flavor as per our convenience. The very common example of Factory design pattern can be found in Spring. Creation of beans in Spring container is done using Factory design pattern only. The implementation is really simple. Create … Continue reading Factory Design Pattern

A Beginner’s Guide to Design Patterns

We use design patterns so that we don’t have to write repeated code again and again for same kind of problem. Design pattern is not a class or piece of code. Its a template which should be implemented based on the situation. Design patterns are divided into following categories:- Behavioral, Creational, Structural Behavioral pattern: As the name explain, Behavioral patterns describe how the objects behave … Continue reading A Beginner’s Guide to Design Patterns

Java 10 Features

So Java SE 10 (JDK 10) was released 20th March 2018. JDK 10 is a production-ready implementation of the Java SE 10 Platform Specification, as specified by JSR 383. Java SE 10 provides a number of new features, including Local variable types, Parallel full GC for G1, Experimental features such as the Java-Based JIT Compiler. etc So this blog can be divided into following categories: What’s New … Continue reading Java 10 Features

Interface vs Abstract Class

Interfaces and Abstract Classes both are the ways to achieve Abstraction in Java. Abstraction is the process to achieve something Abstract and Abstract means something which is not clear and if you are not clear about anything better put it in either Interfaces or Abstract Classes. Though, Java 8 on wards there is not much difference remained between Interfaces and Abstract classes in java, as far … Continue reading Interface vs Abstract Class