Integers are used to store numeric data and declared with the keyword int.There are four standard types of integers, all which can holdd both positive and negativeValues.
Description:
The Number of days in a year is 365
**************************************************************************
Simple Program Using Integers:
- <html>
- <head>
- <title> Simple JSP page </title>
- </head>
- <body>
- <h3>Using the Declaration tag declare page level variables: </h3>
- <p>
- <%!
- int noDays;
- int year=2001;
- int January, February, March;
- %>
- <p>
- <b>Notes:</b>The Declaration tag does not produce any output.
- <p>
- <%
- noDays=365;
- %>
- The Number of days in a year is <%=noDays%>
- </body>
- </html>
Description:
- Type <%! to open the Declaration tag.
- Type int followed by the variable name and a semicolon.ths declares a single variable as an integer.(int noDays;)
- Use the equal sign(=) to assign a value to the variable when it is being initialized.This is known as explicit initialization.(int year=2001;)
- You can initialize more than one variable of same type by separating each variable name with a comma.(int January, February, March;)
- Type %> to close the Declaration tag.
- Type = sign to assign a value to a variable.The value must be placed on the right side of the equal sign.(noDays=365;)
- Use the expression tag to print the value of a variable.(<%=noDays%>)
*************************OUTPUT*****************************************
Using the Declaration tag declare page level variables:
Notes:The Declaration tag does not produce any output.The Number of days in a year is 365
**************************************************************************
ReplyDeleteThanks for publishing this blog, really awesome. Only experienced professional can do this.
Drupal Training in Chennai
Drupal Course in Chennai
Drupal Training
Photoshop Classes in Chennai
Photoshop Course in Chennai
Photoshop Training in Chennai
Drupal Training in Tambaram
Drupal Training in Anna Nagar
I wanted to thank you for this excellent read!! I absolutely loved every little bit of it. I have got you book marked to look at new stuff you post…
ReplyDeleteMicrosoft Windows Azure Training | Online Course | Certification in chennai | Microsoft Windows Azure Training | Online Course | Certification in bangalore | Microsoft Windows Azure Training | Online Course | Certification in hyderabad | Microsoft Windows Azure Training | Online Course | Certification in pune