We can use Integer.parseInt() and Integer.valueOf() to convert String to int.
Epoch time is the number of seconds since January 1st, 1970. 1 minute – 60 seconds 1 hour – 3600 seconds 1 day – 86400 seconds Creating an Epoch Time The easiest way to create epoch time is, using Systerm.currentTimeMillis()
long epoch = System.currentTimeMillis() / 1000;
This time format is not human readable, but it’s suitable to store in a database, business […]
We have already built the REST service using Spring Boot. You can find the article here – Building a simple REST Service with Spring Boot). Now I’ll explain how to build a REST service using Dropwizard. Dropwizard is a simple, light-weight Java framework for developing DevOps friendly, High-performance REST web service. What you will need JDK 1.8 […]
Today, we are going to implement a simple REST web service using spring boot. What you will need JDK 1.8 Maven 3 Spring Boot 1.5.1 IntelliJ (You can use your favorite IDE) Step by Step 1. Create a new Maven project. (You can use Gradle also). 2. Give suitable groupId and artifactId. 3. Now your […]
Stack is a LIFO (Last in first out) data structure. Operations pop() – adds an element in the stack. push() – removes an element from the stack. peek() – get the top element without removing it. isEmpty() – checks whether stack is empty or not. isFull() – checks whether stack is full or not. Implementation […]
When growing no of code lines or developers, increase the software complexity also. Sometimes it’s very difficult to identify the given class responsibility. If we will be able to modularization the project. It’ll be decreased the complexity. Prerequisites Java Maven IntelliJ IDEA (my version is 15) 1. Create a new project. 2. Select “Maven”. […]