Class initialization in Java
Class initialization means initializing all static members of the class. Class in Java is initialized when : An instance of the class is created using either …
Class Loaders in Java
Methods of Java.lang.ClassLoader : public Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException : this method is used to load the classes which are referenced by the …
@RequestBody and @ResponseBody annotations
When using @ResponseBody annotation, developer is still able to explicitly set the content type that the method returns (JSON is used as a content type by …
CommandLineRunner and ApplicationRunner interfaces
Spring Boot provides two interfaces to run specific pieces of code when an application is fully started. These interfaces get called just before run() once SpringApplication …
Maven Dependency Scopes
Let’s observe maven dependency scope differences in detail. For instance, runtime is useful for dependencies required for unit tests and runtime, but not at compile time. …
Building an Application with Spring Boot
For instance, let’s create a simple Web Application. Controller code is shown below: The class is flagged as a @RestController, meaning it is ready for use …
Spring Boot Tutorial
Spring Boot favours convention over configuration and is designed to get developer running application as quickly as possible. Spring Boot uses completely new way of Java …
Guide to Java 8 Optional
Optional class was introduced in Java 8. The purpose of using the class is to provide a type-level solution for representing Optional values instead of null …
About generics
Arrays in Java have always been type-safe : for example, an Array declared as type String (String ) cannot accept Integers (or ints) or anything other …
About enum
As of Java 5, Java lets developers restrict a variable to having one of only a few predefined values – in other words, one value of …