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. Thanks, it worked.
View Tutorial          By: Deepak Varier at 2009-08-19 03:38:07

2. HI All,

I am using this code but fo

View Tutorial          By: muna at 2015-07-04 12:28:15

3. Thank you for the code. Could you please send me c
View Tutorial          By: Ying at 2009-08-17 13:58:16

4. i want every important questions in .net 3.5 and j
View Tutorial          By: pawan at 2011-07-28 06:17:25

5. i m new in java plz send some programs of java usi
View Tutorial          By: supriyo at 2009-09-02 02:03:38

6. if a class is declared as abstract and it contains
View Tutorial          By: nagaraj at 2012-04-25 17:12:30

7. I could not understand, anyone having an easier ex
View Tutorial          By: aatish at 2011-09-14 09:52:28

8. I am trying to execute the same code but still una
View Tutorial          By: Sona at 2015-06-11 18:35:13

9. does anyone know what exactly to use to desgn a ph
View Tutorial          By: andrew willy at 2012-01-29 14:51:13

10. very good example...........
View Tutorial          By: debojit dey at 2010-07-20 15:48:38