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. hi guys,
its working in a good manner impre

View Tutorial          By: saran at 2012-12-18 13:15:12

2. I want get data from Mysql into Spinner by using P
View Tutorial          By: Dilsha at 2013-07-06 05:17:58

3. i want some brief realtime examples
View Tutorial          By: SURYA.C at 2015-08-20 05:06:18

4. how do i get the java tutorial material...
View Tutorial          By: Muruga at 2012-10-29 21:10:17

5. how to connect database simple method
View Tutorial          By: kavimozhian at 2013-04-08 11:14:29

6. Good examples for beginners.
View Tutorial          By: Sagar at 2009-10-16 01:04:46

7. The following line in the code
((NewThread)

View Tutorial          By: Carlos at 2009-11-18 14:34:51

8. thanks. it helped a lot!
View Tutorial          By: lateforbus at 2013-04-25 03:35:24

9. hi!!!!!!!!! MR. RAMLAK will u plz tell the methode
View Tutorial          By: balwant at 2008-11-10 17:19:44

10. very thanks... It's very useful to me...
Th

View Tutorial          By: swathi. M at 2015-01-02 16:32:19