The Artima Developer Community
Sponsored Link

Java Buzz Forum
How to check leap year in Java - program example

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Javin Paul

Posts: 1090
Nickname: javinpaul
Registered: Jan, 2012

Javin Paul is Java Programmer working on Finance domain.
How to check leap year in Java - program example Posted: Dec 22, 2012 1:24 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Javin Paul.
Original Post: How to check leap year in Java - program example
Feed Title: Java67
Feed URL:
Feed Description: Java and technology tutorials, tips, questions for all programmers.
Latest Java Buzz Posts
Latest Java Buzz Posts by Javin Paul
Latest Posts From Java67

Write a Java program to find if a year is a leap year or not is a standard Java programming exercise during various Java programming course on school, colleges and various training institutes both online and offline,  along with other popular homework's e.g. printing Fibonacci numbers, checking palindromes or finding prime numbers. Just to recap a leap year is a year with 366 days which is 1 extra day than normal year. This extra day comes in month of February and on leap year Feb month has 29 days than normal 28 days. If you are following then you might know that leap year comes in a interval of 4 years. This year 2012 is a leap year and Feb has 29 days, you can check. Now if you are in programming before you might be familiar that there is standard logic to find leap year i.e. if an year is multiple of 400 or multiple of 4 but not multiple of 100 then its a leap year. In addition to this standard logic, you can also use Java's Date, Time and Calendar API to check how many days any year has and by comparing that number with 365 you can find whether that year is leap year or not . In this Java programming tutorial we will both of these example to check if a year is leap year or not.
Read more »

Read: How to check leap year in Java - program example

Topic: Getting started with Quartz Scheduler on MySQL database Previous Topic   Next Topic Topic: What Is Challenging For Developers?

Sponsored Links


Copyright © 1996-2018 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use