leap year checker java
Java
public class LeapYear {
public static void main(String[] args) {
int year = 1900;
boolean leap = false;
if(year % 4 == 0)
{
if( year % 100 == 0)
{
// year is divisible by 400, hence the year is a leap year
if ( year % 400 == 0)
leap = true;
else
leap = false;
}
else
leap = true;
}
else
leap = false;
if(leap)
System.out.println(year + " is a leap year.");
else
System.out.println(year + " is not a leap year.");
}
}
Also in Java:
- Title
- Matlab java.lang.IllegalArgumentException: Invalid range
- Category
- Java
- Title
- how to get individual words from a string in java
- Category
- Java
- Title
- how to convert a jsonobject to a dbobject
- Category
- Java
- Title
- How to create a 2d array in java
- Category
- Java
- Title
- the type javax.servlet.ServletException cannot be resolved. It is indirectly referenced from required .class files
- Category
- Java
- Title
- java string split from input string
- Category
- Java
- Title
- java divisible by operator
- Category
- Java
- Title
- java bigdecimal third root
- Category
- Java
- Title
- Caused by: java.lang.NumberFormatException: Invalid int: ""
- Category
- Java
- Title
- java fileinputstream
- Category
- Java
- Title
- android studio clear views of layout
- Category
- Java
- Title
- unity how to make a gameobject slowly look at a position
- Category
- Java
- Title
- java check if variable is set
- Category
- Java
- Title
- declare int java
- Category
- Java
- Title
- update value of an arraylist java
- Category
- Java
- Title
- java compareto
- Category
- Java
- Title
- mettre caractère de string en majuscule java
- Category
- Java
- Title
- how intent
- Category
- Java
- Title
- how to create gravity in java
- Category
- Java
- Title
- how to create dynamic string array in java
- Category
- Java
- Title
- how to find powers in java
- Category
- Java
- Title
- hashset contains java
- Category
- Java
- Title
- joptionpane.showconfirmdialog yes no example
- Category
- Java
- Title
- how to check internet is working or not in java
- Category
- Java
- Title
- scanner in java
- Category
- Java
- Title
- java create clas
- Category
- Java
- Title
- java beginners book
- Category
- Java
- Title
- how to create a Scanner Object in java
- Category
- Java
- Title
- java identifier expected
- Category
- Java
- Title
- how to push an element in hashset java
- Category
- Java
- Title
- java insert new line in string
- Category
- Java
- Title
- filter and map multiple fields from java stream
- Category
- Java
- Title
- what is java plug-in
- Category
- Java
- Title
- delete element from arraylist
- Category
- Java
- Title
- java loop through array
- Category
- Java
- Title
- how to set a windows background image tkinter
- Category
- Java
- Title
- validate request body java
- Category
- Java
- Title
- creating array java
- Category
- Java
- Title
- split with multiple condition in java
- Category
- Java
- Title
- string remove last character
- Category
- Java
- Title
- how to make a minecraft hacked client drawing the hud malicious intent
- Category
- Java
- Title
- java double format
- Category
- Java
- Title
- how to call a static method in java
- Category
- Java
- Title
- set java
- Category
- Java
- Title
- how to format a datetime object to show date and time and milliseconds in java
- Category
- Java
- Title
- HOW TO SUPRESS sonar warning in java code
- Category
- Java
- Title
- code to include layout from java in android
- Category
- Java
- Title
- java get input
- Category
- Java
- Title
- java string to character stream
- Category
- Java
- Title
- how to remove a certain string in a arraylist java
- Category
- Java
- Title
- how to find complement of a number in java
- Category
- Java
- Title
- how do you concatenate an int with a string in java
- Category
- Java
- Title
- how to multiply a number by itself using for loop in java
- Category
- Java
- Title
- how to print each element of an arraylist on a new line in java
- Category
- Java
- Title
- arrays.aslist.add
- Category
- Java
- Title
- spigot chat color with symbol
- Category
- Java
- Title
- raise number to power java
- Category
- Java
- Title
- prime factorization java
- Category
- Java
- Title
- java find biggest number in array
- Category
- Java
- Title
- javafx textarea how to make smaller
- Category
- Java
- Title
- how to make generic arraylist in java
- Category
- Java
- Title
- fibonacci series i logn java
- Category
- Java
- Title
- how to find the intersection of two rectangles in java
- Category
- Java
- Title
- diagonal difference hackerrank solution in java 8 using list
- Category
- Java
- Title
- pretty print json in console
- Category
- Java
- Title
- enum with numbers java
- Category
- Java
- Title
- java create arraly list
- Category
- Java
- Title
- cosinus-1 java
- Category
- Java
- Title
- how to add to a file in java
- Category
- Java
- Title
- java singleton
- Category
- Java
- Title
- java stack pop
- Category
- Java
- Title
- java how to call getReader twice
- Category
- Java
- Title
- how to import a scanner in java
- Category
- Java
- Title
- take string from keyboard java
- Category
- Java
- Title
- bigdecimal divide java
- Category
- Java
- Title
- java integer compareto
- Category
- Java
- Title
- how to make an arraylist java
- Category
- Java
- Title
- excel data formatter in java
- Category
- Java
- Title
- java loop through arraylist
- Category
- Java
- Title
- Jlabel icon
- Category
- Java
- Title
- Don't use a line-beased input after a token-based input.
- Category
- Java
- Title
- java nextpermutation
- Category
- Java
- Title
- java concatenate strings
- Category
- Java
- Title
- java get command line input
- Category
- Java
- Title
- how to create a thread local variable in java
- Category
- Java
- Title
- @fortawesome/free-solid-svg-icons
- Category
- Java
- Title
- official java website
- Category
- Java
- Title
- java random number
- Category
- Java
- Title
- java string to uuid
- Category
- Java
- Title
- what is a method example in java
- Category
- Java
- Title
- creating the functional interface in java
- Category
- Java
- Title
- java open file
- Category
- Java
- Title
- rewrite file java
- Category
- Java
- Title
- iterate map in java
- Category
- Java
- Title
- imagesbutton how to set background
- Category
- Java
- Title
- how to play an audio in java
- Category
- Java
- Title
- arraylist to array java
- Category
- Java
- Title
- java map iteration
- Category
- Java
- Title
- libgdx move camera with touch
- Category
- Java
- Title
- compare string integer java
- Category
- Java