Comment on Tutorial - The switch Statement example in Java By Kamini



Comment Added by : Nick Scroggs

Comment Added at : 2013-03-26 01:44:04

Comment on Tutorial : The switch Statement example in Java By Kamini
@Jai Shankar K

I'm guessing you are not really that familiar with leap years. That's not to be unexpected, after all you're probably not over 113 years old, hell maybe you are not ever 13 years old. However the person who wrote this example knows that when a year is divisible by 100 (ie 500, 1600, 1700, 2000 etc) it may or may not be a leap year. If leap years were every 4 years, then over hundreds or years we would add too much time. Every 400 years our calendar would be off by an additional 3 days. To adjust for this, if a year is divisible by 100 and not by 400 then it is NOT a leap year. If the last two numbers are '00', then only years which are divisible by 400 are leap years. So, only the years 400, 800, 1200, 1600, and 2000 were leap years. 1500, 1700, 1800, and 1900 were not.
There are also leap seconds which are added every now and again for fine tuning.


View Tutorial



Subscribe to Tutorials

Related Tutorials

Program using concept of byte long short and int in java

Update contents of a file within a jar file

Tomcat and httpd configured in port 8080 and 80

Java File

Java String

Count number of vowels, consonants and digits in a String in Java

Reverse a number in Java

Student marks calculation program in Java

Handling Fractions in Java

Calculate gross salary in Java

Calculate average sale of the week in Java

Vector in Java - Sample Program

MultiLevel Inheritance sample in Java

Multiple Inheritance sample in Java

Java program using Method Overriding

Archived Comments

1. i want code to Migration from IPV4 to IPV6 at appl
View Tutorial          By: i want code , can you send me at 2015-01-23 14:38:48

2. This is so phat. Maybe the best explanation ever t
View Tutorial          By: Devin Prince III at 2010-08-11 10:01:04

3. Exception in thread "Thread-0" java.lang
View Tutorial          By: yash at 2009-09-16 06:12:32

4. Hello all,Actually i want xml parser in blackberry
View Tutorial          By: arun at 2011-06-01 06:17:16

5. Excellent information reg the scopes of jsp , plea
View Tutorial          By: venkateshwarreddy suravaram at 2012-01-09 08:34:23

6. crystal clear explanation
View Tutorial          By: digant at 2009-12-08 09:10:06

7. Thanks!! This example was very helpful for me...
View Tutorial          By: Jonathas at 2010-03-11 07:47:51

8. very usefull article............ thanks to the aut
View Tutorial          By: runa at 2010-10-16 08:43:38

9. the correct 255's binary representation is:

View Tutorial          By: SD.Plox at 2008-12-30 17:51:39

10. Thanks for the tutorial. I didn't get a lot of tra
View Tutorial          By: jordan at 2012-05-16 13:03:45