Horje
java check if year is leap Code Example
java check if year is leap
      boolean isLeap =  new GregorianCalendar().isLeapYear(2020);
      //returns true
Leap year or not program in java using if-else
import java.util.Scanner;public class Main{public static void main(String[] args){int year;System.out.println("Enter the year");Scanner sc = new Scanner(System.in);year = sc.nextInt();if (((year % 4 == 0) && (year % 100!= 0)) || (year%400 == 0))System.out.println("it is a leap year");elseSystem.out.println("it is not a leap year");}}
Source: inlarn.com




Java

Related
like in cypher query Code Example like in cypher query Code Example
java Convert a string IPv4 IP address to the equivalent long numeric value. Code Example java Convert a string IPv4 IP address to the equivalent long numeric value. Code Example
how to check number of messages in kafka topic Code Example how to check number of messages in kafka topic Code Example
and roid shape setCornerRadii Code Example and roid shape setCornerRadii Code Example
javafx edit list Code Example javafx edit list Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
11