In this quick tutorial, we will see, how to get current date time using Java 8. Java 8 had come up with new set of classes for date and time under java.time package, which are: – java.time.Instant – java.time.ZonedDateTime – java.time.OffSetDateTime – java.time.LocalDateTime Let us see how we can get current date and time using these classes and how they ...
Read More »Home »
Static Nested Classes Java
In Java, it is possible to define a class within another class. Class defined within another Class is called a Nested Class. Nested class is treated as a member of the Outer class because it is also defined within the Outer class like its other members(variables or methods). public class OuterClass { class NestedClass { } } Although Outer class ...
Read More »Builder Design Pattern
Hello Friends, In this tutorial, we will discuss Builder design pattern. Key topics we are going to discuss are : – Which category Builder Design Pattern falls in ? – What problem builder Pattern is solving or when to use Builder pattern? – Builder Pattern – Builder Pattern Example – Advantages of Builder Pattern – Disadvantages of Builder Pattern Which ...
Read More »How to convert Array to List in Java
Hello Friends, In this tutorial, we will learn, various ways in which we can convert an array to a List. package com.blogspot.javasolutionsguide; import com.google.common.collect.Lists; import org.apache.commons.collections4.CollectionUtils; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; import java.util.LinkedList; import java.util.List; import java.util.stream.Collectors; import java.util.stream.IntStream; import java.util.stream.Stream; public class ArrayToList { public static void main(String[] args) { //Before Java 8 System.out.println("Before JAVA 8........................................"); // 1. ...
Read More »How to Install Maria DB, create Database and Execute Queries
Hello Friends, In this tutorial,we will see : 1. How to Install Maria DB2. How to connect to Maria DB,Create Database and Execute Queries 1. How to Install Maria DB 1.1 Go to following link and click on “Download 10.4.12 Stable Now!” button.As of writing this post,latest stable release of Maria DB is 10.4.12.Please check for latest stable release when you ...
Read More »How to install Apache Web Server on EC2 Instance using User data script
Hello Friends, In this tutorial, we will see how we can install Apache Web Server on EC2 instance using user data script. In one of my previous tutorials,I have already explained how we can launch an EC2 instance using AWS console.If you have not already gone through that,I will recommend to please go through thatfirst ,as that is prerequisite for ...
Read More »How to increase the number of tabs in IntelliJ Idea
Hello Friends, This is a quick small post on increasing the tab limits in the Intellij idea. I recently started using IntelliJ Idea and I am really liking it, but one thing I noticed is, if you have more than 10 tabs opened in your IntelliJ and try to open more, it automatically closes the previously opened tab(s), which I ...
Read More »AWS Lambda to save data in DynamoDB
In this tutorial, we will see how using AWS Lambda we can save data in Dynamo DB. Here are the steps which are required : –Create a table in the Dynamo DB with the name Employee– Create a AWS Lambda function which can save firstName and surName of an employee using a Employee POJO in the Dynamo DB– Create a ...
Read More »AWS Lambda function with Java Pojo as Input Output Example
In the previous tutorial, we saw How to Create AWS Lambda function with Java and we passed String as input and also returned String as Output.I will recommend to go through that tutorial first, if you are creating lambda function for the first time. In this tutorial, we will see, how we can pass Java Plain old Java object(POJO) as input ...
Read More »