Java tutorial
import java.time.YearMonth; import java.time.temporal.ChronoUnit; public class Main { public static void main(String[] args) { YearMonth y = YearMonth.now(); boolean m = y.isSupported(ChronoUnit.YEARS); System.out.println(m); } }