Home » Archives for Mohammad Meraj Zia » Page 4

Author Archives: Mohammad Meraj Zia

Senior Java Developer

Java 8 Display all ZoneId and its UTC offset Example

In this article we will see how to display all ZoneId and its UTC offset. A ZoneId is used to identify the rules used to convert between an Instant and a LocalDateTime. 1. Introduction The java.time package contains the main APIs for dates, times, instants and duration. The classes defined here represent the principle date-time concepts, including instants, durations, dates, times, ...

Read More »

Java 8 Convert Instant to ZonedDateTime Example

In this post, we feature a comprehensive Example on Java 8 Convert Instant to ZonedDateTime. We will discuss about the Java Instant and ZonedDateTime classes and how we can convert a time represented by the Instant to a ZonedDateTime object. 1. Java 8 Convert Instant to ZonedDateTime – Introduction First we will have a look at the Instant class. java.time.Instant ...

Read More »

Java 8 Convert Instant to LocalDateTime Example

In this post, we feature a comprehensive Example on Java 8 Convert Instant to LocalDateTime. First we will learn about Java Instance and LocalDateTime class and then how to convert an Instant object to LocalDateTime. 1. Introduction First we will have a look at the Instant class. java.time.Instant This class models a single instantaneous point on the time-line. This might ...

Read More »

Java 8 Period and Duration Example

In this article we will learn about the Duration and Period classes in Java. These classes were added in Java 8. 1. Introduction A Duration measures an amount of time using time-based values (seconds, nanoseconds). A Period uses date-based values (years, months, days). Duration public final class Duration extends Object implements TemporalAmount, Comparable<Duration>, Serializable   A Duration represents a time-based ...

Read More »

Java RunnableScheduledFuture Example

In this article we will learn about java.util.concurrent.RunnableScheduledFuture class which was introduced in Java 6. 1. Introduction Java RunnableScheduledFuture is a ScheduledFuture that is Runnable. Successful execution of the run method causes completion of the Future and allows access to its results. public interface RunnableScheduledFuture<V> extends RunnableFuture<V>, ScheduledFuture<V> To know how RunnableScheduledFuture works first we need to learn about java.util.concurrent.Future. 1.1 ...

Read More »

Java 9 Jshell Tutorial

1. Introduction In this article we will learn about Java 9 Jshell. The Java Shell tool (JShell) is an interactive tool for learning the Java programming language and prototyping Java code. JShell is a Read-Evaluate-Print Loop (REPL), which evaluates declarations, statements, and expressions as they are entered and immediately shows the results. The tool is run from the command line. Using ...

Read More »

IntelliJ IDEA Code Review Example

In this post, we feature a comprehensive Example on IntelliJ IDEA Code Review. We will learn how we can use IDEA IntelliJ for code reviews. You can also check this tutorial in the following video: Java Programming with IntelliJ IDEA – video 1. Introduction Code review is a systematic examination (sometimes referred to as peer review) of computer source code. ...

Read More »

Spring Security OAuth2 Example

In this article we will learn how to integrate OAuth2 with Spring Security. 1. Introduction Spring Security is a powerful and highly customisable authentication and access-control framework. It is the de-facto standard for securing Spring-based applications. It is a framework that focuses on providing both authentication and authorisation to Java applications. Like all Spring projects, the real power of Spring ...

Read More »

Spring Security Login Example

In this article we will learn how to use spring security to create a simple login page. You will need an IDE (I am using IDEA IntelliJ), JDK 1.8 or later, Maven 3.0+. 1. Introduction The Spring Framework provides a comprehensive programming and configuration model for modern Java-based enterprise applications – on any kind of deployment platform. A key element ...

Read More »

Spring Web Application Example

In this article we will see how to develop a simple web application using Spring framework. This is a very simple example of developing a spring web application; it does not go into the details of performance, security, scaling etc. 1. Introduction Spring Framework is a Java platform that provides comprehensive infrastructure support for developing Java applications. Spring handles the ...

Read More »