Programming Tutorials Browser Tutorials Articles Struts Tutorials Hibernate Tutorials

  Tutorial: Checking whether a year is leap or not

This tutorial is going to teach you the coding for checking whether a year is a leap year or not.

Tutorial Details:

Here, we have taken the year 2000. So define an integer n=2000 in the class "Leapyear" and now apply "if else" condition. As we know leap year is divided by the integer 4 and so applying if condition as n/4=0, then "n" is a leap year. Now in the System.out.println write the message that the year is a leap year. Again applying "else" condition the output will be that the year is not a leap year.


 

Rate Tutorial:
http://roseindia.net/java/beginners/Leapyear.shtml

Read Tutorial at: Click here to view the tutorial

Rate Tutorial:
Checking whether a year is leap or not

View Tutorial:
Checking whether a year is leap or not

Related Tutorials:

Results of first-ever JVM server benchmark revealed - JavaWorld - December 1997
Results of first-ever JVM server benchmark revealed - JavaWorld - December 1997
 
Which Java VM scales best? - JavaWorld - August 1998
Which Java VM scales best? - JavaWorld - August 1998
 
The Volano Report: Which Java platform is fastest, most scalable? A JavaWorld exclusive! - JavaWorld - Mar
The Volano Report: Which Java platform is fastest, most scalable? A JavaWorld exclusive! - JavaWorld - March 1999
 
SQLJ: The 'open sesame' of Java database applications
SQLJ: The 'open sesame' of Java database applications
 
One, two, three, or n tiers? - JavaWorld January 2000
One, two, three, or n tiers? - JavaWorld January 2000
 
Secure thread collaboration across protection domains - JavaWorld December 2000
Secure thread collaboration across protection domains - JavaWorld December 2000
 
Build your own languages with JavaCC - JavaWorld December 2000
Build your own languages with JavaCC - JavaWorld December 2000
 
Make bad code good - JavaWorld March 2001
Make bad code good - JavaWorld March 2001
 
Optimistic Locking pattern for EJBs - JavaWorld July 2001
Optimistic Locking pattern for EJBs - JavaWorld July 2001
 
Yes, you can secure your Web services documents, Part 2
Yes, you can secure your Web services documents, Part 2
 
Sort it out
Sort it out
 
Java Tip 134: When catching exceptions, don't cast your net too wide
Java Tip 134: When catching exceptions, don't cast your net too wide
 
Create client-side user interfaces in HTML, Part 2
Create client-side user interfaces in HTML, Part 2
 
To my mind, of few interest
To my mind, of few interest
 
CalendarComponent
Java Calendar Component V 1.0
 
A Rendezvous with Java
A Rendezvous with Java During WWDC this year, Apple released Java source for Rendezvous. You can now write Java applications that can call on a Rendezvous service discovery on Mac OS X, Windows, and any POSIX system using code supplied by Apple. Apple in
 
Annotations in Tiger, Part 1: Add metadata to Java code
Annotations, a new feature in J2SE 5.0 (Tiger), brings a much-needed metadata facility to the core Java language. In this first of a two-part series, author Brett McLaughlin explains why metadata is so useful, introduces you to annotations in the Java lan
 
Can't beat Jazzy
Introducing the Java platform's Jazzy new spell checker API.
 
Bridging the Gap: J2SE 5.0 Annotations
Bridging the Gap: J2SE 5.0 Annotations It takes a long time for the Java community to fully absorb a major new JDK release; it seems to take about two more releases after a brand new version of the JDK before everything settles down. Application server v
 
JavaRSS.com 2004: Review of the Year
A look back at the major events of 2004 in Java.
 
Site navigation
 

 

Send your comments, Suggestions or Queries regarding this site at roseindia_net@yahoo.com.

Copyright © 2006. All rights reserved.