FastFoodCoding

Login


Connect with one of the following accounts





Login

Please wait while we redirect...

Views: 76   



Following program shows you how to print present year.
We can get present year using Year.now().getValue() in java.

import java.time.Year;

public class Basic14 {

    public static void main(String[] args) {

        int year = Year.now().getValue();

        System.out.println("Present year is: " + year);

    }

}

Output:

Present year is: 2018



On By


Top Tutorials

Top Questions

Top Articles

Top Blogs

Top News