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 build j2me application for reading text file....
View Tutorial          By: ganesh at 2012-10-17 10:34:00

2. This can also prevent Outlook from using the autod
View Tutorial          By: Morgster79 at 2012-03-21 05:07:42

3. "THIS IS SAMPLE EXMPLE!!!!!!!!!!11111"
View Tutorial          By: david billa at 2012-08-02 06:23:43

4. Thank you so much Eric Giguere.
You save me

View Tutorial          By: ijAcK D at 2009-10-18 05:02:48

5. this text is overlapping the existing text what if
View Tutorial          By: Alda at 2015-10-02 18:22:22

6. hi,
thier is an error coming with me when i

View Tutorial          By: Tarun at 2013-02-17 03:13:21

7. hi....!
This program is working well in co

View Tutorial          By: param at 2014-10-15 07:02:49

8. Hi All,

I am new to J2ME Applicatio

View Tutorial          By: golemnagesh at 2010-12-05 22:43:50

9. very good helped me a lot
View Tutorial          By: Swaran at 2009-12-30 09:51:36

10. hi! im new in j2me applications so i just cleaned
View Tutorial          By: resego at 2010-08-04 07:29:29