Sunday, February 14, 2021

Create a maven project in eclipse

1. Open eclipse tool->File->Other.







2. Click on Other->Select Maven->Click Next button.






3. Select the first checkbox (Skip archetype) What is an archetype






4. Enter Group id and Artificate id.





5. Your Maven project is created.








Saturday, January 2, 2021

Java 8 - Date and Time API

1. Get the Local Date 

package Java8;

import java.time.LocalDate;

public class DateTime {


public static void main(String[] args) {

dateTime dt = new dateTime();

LocalDate date = LocalDate.now();

LocalDate yesterday = date.minusDays(1);

LocalDate tomorrow = yesterday.plusDays(2);

System.out.println("Today date is : " + date);

System.out.println("Yesterday date is : " + yesterday);

System.out.println("Tomorrow date is: " + tomorrow);

}


}


output: 

Today date is: 2021-01-02

Yesterday date is: 2021-01-01

Tomorrow date is: 2021-01-03